Part Number Hot Search : 
12S05 0123M 0123M BCM56504 BCM56504 BDG1A MP8715DN 07M01
Product Description
Full Text Search
 

To Download MAXQ3183 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  general description the MAXQ3183 is a dedicated electricity measurementfront-end that collects and calculates polyphase volt- age, current, power, energy, and many other metering and power-quality parameters of a polyphase load. the computed results can be retrieved by an external mas- ter through the on-chip serial peripheral interface (spi?) bus. this bus is also used by the external mas- ter to configure the operation of the MAXQ3183 and monitor the status of operations. the MAXQ3183 performs voltage and current measure- ments using an integrated adc that can measure up to seven external differential signal pairs. an eighth differ- ential signal pair is used to measure the die tempera- ture. an internal amplifier automatically adjusts the current channel gain to compensate for low-current channel-signal levels. applications 3-phase multifunction electricity meters features ? compatible with 3-phase/3-wire, 3-phase/4-wire ? active power and energy of each phase andcombined 3-phase (kwh), positive and negative ? reactive power and energy of each phase andcombined 3-phase, positive and negative ? apparent power and energy of each phase andcombined 3-phase ? neutral line current measurement ? vector sum of 3-phase currents and neutralcurrent ? line frequency (hz) ? power factors ? voltage phasor angles ? voltage and current phase sequence indications ? phase voltage absence detection ? voltage and current harmonic measurement ? phase current thdn ? fundamental and total power and energy ? ac/dc mode current and voltage measurement ? two pulse outputs: configurable for active,reactive, and apparent powers ? programmable meter constants and pulse widths ? programmable no-load current threshold ? programmable thresholds for undervoltage andovervoltage detection ? programmable threshold for overcurrent detection ? programmable vector sum threshold for bypassdetection ? amp-hours in absence of voltage signals ? on-chip digital temperature sensor ? precision internal voltage reference 2.048v(30ppm/? typical), also supports an external voltage reference ? supports software meter calibration ? up to 3-point multipoint calibration tocompensate for transducer nonlinearity ? power-fail detection ? bidirectional reset input/output ? spi-compatible serial interface with interruptrequest ( irq ) output ? single 3.3v supply, low power (35mw typical) MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ________________________________________________________________ maxim integrated products 1 19-4955; rev 0; 12/09 for pricing, delivery, and ordering information, please contact maxim direct at 1-888-629-4642, or visit maxim? website at www.maxim-ic.com. note: some revisions of this device may incorporate deviations from published specifications known as errata. multiple revisions of any device may be simultaneously available through various sales channels. for information about device errata, go to: www.maxim-ic.com/errata . maxq is a registered trademark of maxim integrated products, inc. spi is a trademark of motorola, inc. ordering information + denotes a lead(pb)-free/rohs-compliant package. part temp range pin-package MAXQ3183-ran+ -40 c to +85 c 28 tssop pin configuration and typical application circuit appear at end of data sheet. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 2 _______________________________________________________________________________________ absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 metering specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 spi slave mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 analog front-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 digital signal processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 precision pulse generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 spi peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 reset sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 external reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 watchdog reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 software reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 power-supply monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 external high-frequency crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 external high-frequency clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 internal rc oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 master communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 spi communications rate and format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 spi communications protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 host software design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 register set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 ram-based registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 general operating registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 global status register (status) (0x000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 operating mode register 0 (opmode0) (0x001) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 operating mode register 1 (opmode1) (0x002) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 operating mode register 2 (opmode2) (0x003) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 table of contents downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect _______________________________________________________________________________________ 3 global interrupt registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 interrupt request flag register (irq_flag) (0x004) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 interrupt mask register (irq_mask) (0x006) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 meter pulse configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 pulse configurationcfp output (plscfg1) (0x01e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 pulse configurationcfq output (plscfg2) (0x01f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 cfp pulse width (pls1_wd) (0x020) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 cfp pulse threshold (thr1) (0x022) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 cfq pulse width (pls2_wd) (0x026) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 cfq pulse threshold (thr2) (0x028) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 calibration registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 current gain, phase x = a/b/c/n (x.i_gain) (a: 0x130, b: 0x21c, c: 0x308, n: 0x12e) . . . . . . . . . . . . . . . . . .37 voltage gain, phase x = a/b/c (x.v_gain) (a: 0x132, b: 0x21e, c: 0x30a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 energy gain, phase x = a/b/c (x.e_gain) (a: 0x134, b: 0x220, c: 0x30c) . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 8 phase-angle compensation, high range, phase x = a/b/c (x.pa0) (a: 0x13e, b: 0x22a, c: 0x316) . . . . . . . .38 phase-angle compensation, medium range, phase x = a/b/c (x.pa1) (a: 0x140, b: 0x22c, c: 0x318) . . . . .39 phase-angle compensation, low range, phase x = a/b/c (x.pa2) (a: 0x142, b: 0x22e, c: 0x31a) . . . . . . . . .39 limit registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 overcurrent level (oclvl) (0x044) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 overvoltage level (ovlvl) (0x046) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 undervoltage level (uvlvl) (0x048) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 no-load level (noload) (0x04a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 current vector sum threshold (isumlvl) (0x054) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 phase status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 interrupt flags, phase x = a/b/c (x.flags) (a: 0x144, b: 0x230, c: 0x31c) . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 interrupt mask, phase x = a/b/c (x.mask) (a: 0x145, b: 0x231, c: 0x31d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 energy overflow flags, phase x = a/b/c (x.eover) (a: 0x146, b: 0x232, c: 0x31e) . . . . . . . . . . . . . . . . . . . . .42 measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 line frequency (linefr) (0x062) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 power factor, phase x = a/b/c (x.pf) (a: 0x1c6, b: 0x2b2, c: 0x39e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 rms voltage, phase x = a/b/c (x.vrms) (a: 0x1c8, b: 0x2b4, c: 0x3a0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 3 rms current, phase x = a/b/c (x.irms) (a: 0x1cc, b: 0x2b8, c: 0x3a4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 4 energy, real positive, phase x = a/b/c (x.eapos) (a: 0x1e8, b: 0x2d4, c: 0x3c0) . . . . . . . . . . . . . . . . . . . . .44 energy, real negative, phase x = a/b/c (x.eaneg) (a: 0x1ec, b: 0x2d8, c: 0x3c4) . . . . . . . . . . . . . . . . . . . .45 energy, reactive positive, phase x = a/b/c (x.erpos) (a: 0x1f0, b: 0x2dc, c: 0x3c8) . . . . . . . . . . . . . . . . . .45 energy, reactive negative, phase x = a/b/c (x.erneg) (a: 0x1f4, b: 0x2e0, c: 0x3cc) . . . . . . . . . . . . . . . . .46 energy, apparent, phase x = a/b/c (x.es) (a: 0x1f8, b: 0x2e4, c: 0x3d0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 table of contents (continued) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 4 _______________________________________________________________________________________ virtual register conversion coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 voltage units conversion coefficient (volt_cc) (0x014) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 current units conversion coefficient (amp_cc) (0x016) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 power units conversion coefficient (pwr_cc) (0x018) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 energy units conversion coefficient (enr_cc) (0x01a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 temperature conversion coefficient (temp_cc) (0x060) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 virtual registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 real power, phase x = a/b/c/t (pwrp.x) (a: 0x801, b: 0x802, c: 0x804, t: 0x807) . . . . . . . . . . . . . . . . . .51 reactive power, phase x = a/b/c/t (pwrq.x) (a: 0x811, b: 0x812, c: 0x814, t: 0x817) . . . . . . . . . . . . . .51 apparent power, phase x = a/b/c/t (pwrs.x) (a: 0x821, b: 0x822, c: 0x824, t: 0x827) . . . . . . . . . . . . . .52 voltage and current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 rms volts, phase x = a/b/c (v.x) (a: 0x831, b: 0x832, c: 0x834) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 rms amps, phase x = a/b/c/n (i.x) (a: 0x841, b: 0x842, c: 0x844, n: 0x840) . . . . . . . . . . . . . . . . . . . . . .52 power factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 power factor (pf.t) (0x867) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 real energy, phase a/b/c/t (enrp.x) (a: 0x8c1, b: 0x8c2, c: 0x8c4, t: 0x8c7) . . . . . . . . . . . . . . . . . . . .53 reactive energy, phase a/b/c/t (enrq.x) (a: 0x8d1, b: 0x8d2, c: 0x8d4, t: 0x8d7) . . . . . . . . . . . . . . . .53 apparent energy, phase a/b/c/t (enrs.x) (a: 0x871, b: 0x872, c: 0x874, t: 0x877) . . . . . . . . . . . . . . . . .53 theory of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 analog front-end operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 digital signal processing (dsp) terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 digital processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 per sample operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 per dsp cycle operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 energy accumulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 no-zero-crossing detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 phase sequence status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 rms voltage, rms current, and energy calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 power calculation (active, reactive, apparent) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 energy accumulation start delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 no-load feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 on demand calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 rms volts, rms amps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 power factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 table of contents (continued) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect _______________________________________________________________________________________ 5 line frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 phasor angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 meter pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 generating pulses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 meter constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 overvoltage and overcurrent detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 meter units to real units conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 units conversion examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 calibration procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 calibration overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 calibrating voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 calibrating current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 calibrating phase offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 interfacing the MAXQ3183 to external hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 connections to the power source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 sensor selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 voltage sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 voltage-divider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 voltage transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 current sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 current shunt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 current transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 advanced operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 modifying the adc operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 fine-tuning the dsp controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 fine-tuning the line frequency measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 fundamental mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 harmonic measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 current total harmonic distortion plus noise (thdn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 current vector sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 low-power measurement mode (lowpm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 advanced calibrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 calibrating current offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 calibrating linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 table of contents (continued) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 6 _______________________________________________________________________________________ calibrating power/energy gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 multipoint phase offset calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 advanced register configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 analog scan configuration registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 time slot assignmentcurrent channel x = a/b/c (scan_ix) (a: 0x008, b: 0x00c, c: 0x00a) . . . . . . . . .73 time slot assignmentvoltage channel x = a/b/c (scan_vx) (a: 0x009, b: 0x00d, c: 0x00b) . . . . . . . .74 time slot assignmentneutral current channel (scan_in) (0x00e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 time slot assignmenttemperature channel (scan_te) (0x00f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 neutral current and harmonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 auxiliary channel configuration (aux_cfg) (0x010) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 dsp system configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 system clock frequency (sys_khz) (0x012) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 cycle count (cycnt) (0x01c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 number of scan frames per dsp cycle (ns) (0x040) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 filter coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 line cycle noise rejection filter (rej_ns) (0x02c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 line cycle averaging filter (avg_ns) (0x02e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 meter measurement averaging filter (avg_c) (0x030) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 meter measurement highpass filter (hpf_c) (0x032) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 fundamental filter feed-forward coefficient (b0fund) (0x034) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 1 fundamental filter feedback coefficient (a1fund) (0x036) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 harmonic filter feed-forward coefficient (b0harm) (0x03a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 harmonic filter feedback coefficient (a1harm) (0x03c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 zero-cross lowpass filter (zc_lpf) (0x05a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 hardware mirror registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 adc configuration (r_acfg) (0x04c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 adc conversion rate (r_adcrate) (0x04e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 adc settling time (r_adcacq) (0x050) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 spi configuration (r_spicf) (0x052) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 communications timeout (com_timo) (0x056) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 energy accumulation timeout (acc_timo) (0x058) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 phase-angle compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 phase offset current threshold 1 (i1thr) (0x05c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 phase offset current threshold 2 (i2thr) (0x05e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 table of contents (continued) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect _______________________________________________________________________________________ 7 miscellaneous gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 neutral current gain (n.i_gain) (0x12e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 gain, fundamental energy, phase x = a/b/c (x.ef_gain) (a: 0x136, b: 0x222, c: 0x30e) . . . . . . . . . . . . .88 linearity compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88 linearity offset, high range, phase x = a/b/c (x.offs_hi) (a: 0x138, b: 0x224, c: 0x310) . . . . . . . . . . . .88 linearity gain coefficient, low range, phase x = a/b/c (x.gain_lo) (a: 0x13a, b: 0x226, c: 0x312) . . .88 linearity offset, low range, phase x = a/b/c (x.offs_lo) (a: 0x13c, b: 0x228, c: 0x314) . . . . . . . . . . .89 measurementsram registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 on-demand rms result (n.irms) (0x11c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 fundamental energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 fundamental energy overflow flags, phase x = a/b/c (x.efover) (a: 0x147, b: 0x233, c: 0x31f) . . . . .90 energy, fundamental, real positive, phase x = a/b/c (x.eafpos) (a: 0x1fc, b: 0x2e8, c: 0x3d4) . . . . .90 energy, fundamental, real negative, phase x = a/b/c (x.eafneg) (a: 0x200, b: 0x2ec, c: 0x3d8) . . . .91 energy, fundamental, reactive positive, phase x = a/b/c (x.erfpos) (a: 0x204, b: 0x2f0, c: 0x3dc) . .91 energy, fundamental, reactive negative, phase x = a/b/c (x.erfneg) (a: 0x208, b: 0x2f4, c: 0x3e0) .92 energy fundamental, apparent, phase x = a/b/c (x.esf) (a: 0x20c, b: 0x2f8, c: 0x3e4) . . . . . . . . . . . . .92 energy accumulated in the last dsp cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 real energy, phase x = a/b/c (x.act) (a: 0x1d0, b: 0x2bc, c: 0x3a8) . . . . . . . . . . . . . . . . . . . . . . . . . . .93 reactive energy, phase x = a/b/c (x.rea) (a: 0x1d4, b: 0x2c0, c: 0x3ac) . . . . . . . . . . . . . . . . . . . . . . . .93 apparent energy, phase x = a/b/c (x.app) (a: 0x1d8, b: 0x2c4, c: 0x3b0) . . . . . . . . . . . . . . . . . . . . . . . .94 fundamental energy accumulated in the last dsp cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 fundamental real energy, phase x = a/b/c (x.actf) (a: 0x1dc, b: 0x2c8, c: 0x3b4) . . . . . . . . . . . . . . .94 fundamental reactive energy, phase x = a/b/c (x.reaf) (a: 0x1e0, b: 0x2cc, c: 0x3b8) . . . . . . . . . . . .95 fundamental apparent energy, phase x = a/b/c (x.appf) (a: 0x1e4, b: 0x2d0, c: 0x3bc) . . . . . . . . . . . .95 checksum (chksum) (0x066) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 measurementsvirtual registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 fundamental real power, phase a/b/c/t (pwrpf.x) (a: 0x881, b: 0x882, c: 0x884, t: 0x887) . . . . . . . . . . . . .97 fundamental reactive power, phase a/b/c/t (pwrqf.x) (a: 0x891, b: 0x892, c: 0x894, t: 0x897) . . . . . . . . .97 fundamental apparent power, phase a/b/c/t (pwrsf.x) (a: 0x8a1, b: 0x8a2, c: 0x8a4, t: 0x8a7) . . . . . . . .98 fundamental real energy, phase a/b/c/t (enrpf.x) (a: 0x8e1, b: 0x8e2, c: 0x8e4, t: 0x8e7) . . . . . . . . . . . .98 fundamental reactive energy, phase a/b/c/t (enrqf.x) (a: 0x8f1, b: 0x8f2, c: 0x8f4, t: 0x8f7) . . . . . . . . .98 fundamental apparent energy, phase a/b/c/t (enrsf.x) (a: 0x8b1, b: 0x8b2, c: 0x8b4, t: 0x8b7) . . . . . . . .99 current total harmonic distortion plus noise, phase a/b/c (thdn.x) (a: 0x859, b:0x85a, c: 0x85c) . . . . . . .99 phasors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 phase b phasor (vbph: 0x852) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 phase c phasor (vcph: 0x854) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 table of contents (continued) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 8 _______________________________________________________________________________________ harmonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 rms voltage, harmonic (v.harm) (0x830) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 rms current, harmonic/neutral (i.n, i.harm) (0x840) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 ratio of harmonic/fundamental (harm_nf) (0x850) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 special commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 applications information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 grounds and bypassing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 specific design considerations for MAXQ3183-based systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 additional documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 technical support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 typical application circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 table of contents (continued) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect _______________________________________________________________________________________ 9 figure 1. external reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 figure 2. brownout reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 figure 3. simplified clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 figure 4a. spi interface timing (ckpha = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 figure 4b. spi interface timing (ckpha = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 figure 5. read spi transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 figure 6. write spi transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 figure 7. flowchart for reading from MAXQ3183 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 figure 8. flowchart for writing to MAXQ3183 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 figure 9. per sample operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 figure 10. computation of rms values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 figure 11. phase compensation for energy calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 figure 12. apparent and reactive energy calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 figure 13. sample voltage input circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 figure 14. sample current input circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 figure 15. offset testing setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 figure 16. phase offset vs. input current calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 table 1. command format for spi register read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 table 2. command format for spi register write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 table 3. ram register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 table 4. virtual register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 table 5. meter unit definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 table 6. virtual register coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 table 7. virtual registers that activate special commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 list of figures list of tables downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 10 ______________________________________________________________________________________ stresses beyond those listed under absolute maximum ratings may cause permanent damage to the device. these are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. voltage range on dvdd relative to dgnd .........-0.3v to +4.0v voltage range on avdd relative to agnd..........-0.3v to +4.0v voltage range on agnd relative to dgnd .........-0.3v to +0.3v voltage range on avdd relative to dvdd ..........-0.3v to +0.3v voltage range on any pin relative to dgnd except vxp, ixn pins..............................-0.3v to +4.0v voltage range on vxp, ixn relative to agnd ......-0.3v to +4.0v operating temperature range ...........................-40c to +85c junction temperature ......................................................+150c storage temperature range .............................-65c to +150c lead soldering temperature .............................refer to the ipc/ jedec j-std-020 specification. parameter conditions min typ max units active energy linearity error dr 1000:1 0.1 % reactive energy linearity error dr 1000:1 0.2 % apparent energy linearity error dr 1000:1 0.5 % rms voltage linearity error dr 20:1 0.5 % dr 500:1 1.0 rms current linearity error dr 20:1 0.5 % line frequency error 0.5 % power factor error 1.0 % electrical characteristics(v avdd = v dvdd = v rst to 3.6v, t a = -40c to +85c, unless otherwise noted.) (note 2) parameter symbol conditions min typ max units power-supply specifications digital supply voltage v dvdd v rst 3.6 v power-fail interrupt trip point v pfw active mode, epwrf = 1 2.84 3.13 v power-fail reset trip point v rst active mode 2.70 2.99 v analog supply voltage v avdd v rst 3.6 v analog supply current i avdd f clk = 8mhz 0.9 1.8 ma digital supply current i dvdd f clk = 8mhz 8.5 13 ma low-power measurement mode current i lowpm lowpm = 1 (note 1) 4.2 ma stop-mode current 0.2 12 a digital i/o specifications input high voltage v ih 0.7 x v dvdd v input low voltage v il 0.3 x v dvdd v input hysteresis v ihys v dvdd = 3.3v 500 mv input leakage i l v in = dgnd or v dvdd , pullup off 0.01 1 a metering specifications(v avdd = v dvdd = v rst to 3.6v, current channel dynamic range 1000:1 at t a = +25c, unless otherwise noted.) (note 1) absolute maximum ratings downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 11 electrical characteristics (continued)(v avdd = v dvdd = v rst to 3.6v, t a = -40c to +85c, unless otherwise noted.) (note 2) parameter symbol conditions min typ max units input low current i il v in = 0.4v, weak pullup on -50 a reset pullup resistance r reset 50 150 200 k  i oh = -4ma v dvdd - 0.4 output high voltage (except reset ) v oh i oh = -6ma v dvdd - 0.5 v i ol = 4ma 0.4 output low voltage v ol i ol = 6ma 0.5 v system clock sources external clock input frequency 0 8.12 mhz external clock input duty cycle 45 55 % external hf crystal frequency f sys fundamental mode 8.12 mhz xtal1, xtal2 internal load capacitance 16 pf internal rc oscillator frequency 7.4 7.6 8.6 mhz internal rc oscillator accuracy 2 % internal rc oscillator current 50 120 a internal rc oscillator startup delay (note 1) 0.45 s analog-to-digital converter input voltage range 0 v ref v common-mode bias v comm 1.14 v offset error 2 mv offset error drift 8 v/ c gain error (g = 1) 0.05 % spurious-free dynamic range sfdr 90 db total harmonic distortion thd 90 db input bandwidth (-3db) (note 1) 7 khz internal voltage reference temperature coefficient (note 1) 30 ppm/ c output voltage v ref 2.048 v internal temperature sensor temperature error (note 1) -4 +4 c spi slave-mode interface timing maximum spi clock rate f sys /4 mhz sclk input pulse-width high t sch (note 3) 4 x t sys ns sclk input pulse-width low t scl (note 3) 4 x t sys ns downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 12 ______________________________________________________________________________________ electrical characteristics (continued)(v avdd = v dvdd = v rst to 3.6v, t a = -40c to +85c, unless otherwise noted.) (note 2) parameter symbol conditions min typ max units ssel low to first sclk edge (slave enable) t se (note 3) 4t sys ns last sclk edge to ssel high (slave disable) t sd t sys + 5 ns mosi valid to sclk sample edge (mosi setup) t sis 5 ns sclk sample edge to mosi change (mosi hold) t sih t sys + 5 ns sclk shift edge to miso valid (miso hold) t sov 3t sys + 5 ns note 1: specifications guaranteed by design but not production tested. note 2: specifications to -40c are guaranteed by design and are not production tested. note 3: t sys = 1/f sys . spi slave mode timing ssel shift edge sample edge sclk data output data input t sd t se t sov t sis t sih t scl t sch downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 13 block diagram MAXQ3183 cfp, cfq counters i/o buffers i/o registers adc cfq cfp v2p i0p v0p vcomm reset vref v1p i1p i2p inp spi i/o buffers i/o registers watchdog timer adc clock prescaler miso mosi sclk ssel xtal1 sysclk adcclk xtal2 i/o buffers i/o registers hf rc osc/8 hf xtal osc por/ brownout monitor 16 x 16 hw multiply 48-bit accumulate irq i2n vn i0n i1n temp sense ref adc control, electricity metering dsp, communications manager downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 14 ______________________________________________________________________________________ pin description pin name function power pins 17, 22 dvdd digital supply voltage 25 avdd analog supply voltage 18 dgnd digital ground 9 agnd analog ground 23 vcomm voltage bias. this pin can be used to create an input common-mode dc offset for a dc channel conversions. 24 vref voltage reference. reference voltage for the adc. an external reference voltage can be con nected to this pin when extremely high accuracy is required. voltage and current pins 26, 3, 4 v0p, i0p, i0n phase a voltage and current analog inputs 27, 5, 6 v1p, i1p, i1n phase b voltage and current analog inputs 28, 7, 8 v2p, i2p, i2n phase c voltage and current analog inputs 1 vn analog input for common voltage 2 inp analog input for neutral current clock pins 10 xtal2 11 xtal1 high-frequency crystal input/output. when using an external hi gh-frequency crystal, the crystal oscillator circuit s hould be connected between xtal1 and xtal2. when using an externally d riven clock (extclk = 1), the clock should be input at xtal1, with xtal 2 left unconnected. 12 irq interrupt request output. this line is driven low by the device to i ndicate to the master that an unmasked interrupt has occurred. 13 ssel slave select input. this line is the active-low slave select input for the spi interface. 14 sclk slave clock input. this line is the clock input for the spi in terface. 15 mosi master out-slave in input. this line is used by the master to trans mit data to the slave (the MAXQ3183) over the spi interface. 16 miso master in-slave out output. this line is used by the MAXQ3183 (the sla ve) to transmit data back to the master over the spi interface. 19 cfp pulse output 1. configurable to represent energy or rms voltage or curr ent. 20 cfq pulse output 2. configurable to represent energy or rms voltage or curr ent. 21 reset active-low reset input/output. an external master can reset the ma xq3183 by driving this pin low. this pin includes a weak pullup resistor to allow for a combinat ion of wired-or external reset sources. an rc circuit is not required for power-up, as this fu nction is provided internally. this pin also acts as a reset output when the source of the reset is internal to the device (power-fail, watchdog reset, etc.). in this case, the reset pin is held low by the device until it exits the reset state, the n the reset pin is released. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 15 detailed description the MAXQ3183 contains four major subsections: theanalog front-end, the digital signal processor, the preci- sion pulse generators, and an spi peripheral for com- munication to the host processor. analog front-end the analog front-end (afe) is an 8-channel analog-to-digital converter (adc). it operates autonomously in the standard configuration, assigning three channels to phase a, b, and c voltage; three channels to phase a, b, and c current; one channel to neutral current; and the last channel to a temperature sensor. each channel also contains a programmable-gain amplifier capable of providing a gain of 1, 2, 4, 8, 16, or 32 incoming signals. only the voltage channels permit gain scaling by the host processor. the MAXQ3183 dsp firmware automatically sets the gain on current channels. digital signal processor the dsp code is permanently embedded in maskedrom and accepts raw current and voltage samples for each of three phases and continuously calculates a host of values including rms volts, rms amps, real energy, reactive energy, apparent energy, fundamental and harmonic energy, and power factor. the MAXQ3183 dsp core processes incoming sam- ples from the analog front-end according to user con- figurations. the host sets these operating parameters by specifying addresses within the device ram space. when a calculation cycle is complete, the results are placed back into ram as well. thus, the dsp core uses the ram block as both its input (for operating parame- ters) and output (for calculation results) medium. see the spi peripheral section for how the host writes oper- ating parameters and reads results from the ram.the dsp also calculates certain values such as line fre- quency and active and reactive powers only when demanded by the host. precision pulse generators the MAXQ3183 includes two precision pulse genera-tors that generate a pulse whenever certain conditions are met. in the MAXQ3183, many meter quantities can be selected for conversion to meter pulses including absolute energy, net energy, reactive energy, voltage, and current. the pulse generators are accumulators. on each dsp cycle, whatever quantity is being measuredreal ener- gy, reactive energy, current, or something elseis added to the pulse accumulator. the pulse accumula-tor is then tested to determine if the value in the accu- mulator is greater than the threshold. if it is greater, the threshold value is subtracted from the accumulator value and the meter pulse starts. spi peripheral the spi controller is a slave-only device that can reador write any location in the data ram. additionally, it can request data from on-demand registers. the MAXQ3183 implements a truly full-duplex commu- nication, rather than the pseudo half-duplex mode used by other spi peripherals. that is, each time a character is received by the MAXQ3183, a meaningful character is returned to the host. often, this is a protocol charac- ter. in this way, the host can be assured that the com- mand has been received and is valid. optional error checking can also be enabled to further guarantee proper operation. operating modes the MAXQ3183 has two basic modes of operation,each of which is described in the following sections. the initialization mode is the default mode upon power- up or following reset; entry to and exit from the other operating modes is only performed as a result of com- mands sent by the master. run mode this mode is the normal operating mode for theMAXQ3183. in this mode, the MAXQ3183 continuously executes the following operations: ? scans analog front-end channels and collects raw voltage and current samples. ? processes voltage and current samples through dsp filters as enabled and configured. ? calculates power, energy, and other required quanti- ties and stores these values in ram registers. ? responds to register write and read commands from the master. ? outputs power pulses on cfp and cfq as configured. ? drives irq when an interrupt condition has been detected and the interrupt is not masked. stop mode this mode places the MAXQ3183 into a power-savingstate where it consumes the least possible amount of current. in stop mode, all functions are suspended, including the adc and power and voltage measurement and processing. the MAXQ3183 does not respond to any commands from the master in this operating state. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 16 ______________________________________________________________________________________ entry into stop mode only occurs at the request of themaster. to place the MAXQ3183 into stop mode, the master must read the enter stop (0xc02) register. once this register has been read, the MAXQ3183 enters stop mode immediately, before the transmission of the final ack byte by the MAXQ3183. there are three possible ways to bring the MAXQ3183 back out of stop mode. ? power cycle. the MAXQ3183 automatically exits stop mode if a power-on reset occurs. following exitfrom stop mode, all registers are cleared back to their default states, and the MAXQ3183 transitions to initialization mode. ? external reset. the MAXQ3183 exits stop mode if an external reset is triggered by driving reset low. once the reset pin is released and allowed to return to a high state, the MAXQ3183 comes out ofreset and goes into initialization mode. all registers are cleared to their default states when exiting stop mode in this manner. ? external interrupt. driving the ssel pin low causes the MAXQ3183 to exit stop mode without undergoinga reset cycle. when exiting stop mode in this man- ner, all register and configuration settings are retained, and the MAXQ3183 automatically resumes electric-metering functions and sample processing. note that when the master is communicating with the MAXQ3183, the ssel line is normally driven low at the beginning of each spi command. this means that if themaster sends an spi command after the MAXQ3183 enters stop mode, the MAXQ3183 automatically exits stop mode. reset sources there are several different sources that can cause theMAXQ3183 to undergo a reset cycle. for any type of hardware reset, the reset pin is driven low when a reset occurs. external reset this hardware reset is initiated by an external source(such as the master controller or a manual pushbutton press) driving the reset pin on the MAXQ3183 low. the reset line must be held low for at least four cycles of the currently selected clock for the external reset totake effect. once the external reset takes effect, it remains in effect indefinitely as long as reset is held low. once the external reset has been released, theMAXQ3183 clears all registers to their default states and resumes execution in initialization mode. when an external reset occurs outside of stop mode, execution (in initialization mode) resumes after four cycles of the currently selected clock (external high-fre- quency crystal for run mode, 1mhz internal rc oscilla- tor for lowpm mode). as the MAXQ3183 enters initialization mode, the lowpm bit is always cleared clock resetreset sampling internal reset begin running in initialization mode figure 1. external reset downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 17 t por v rst1 brownout detection brownout detection (always enabled outside of stop mode) forces reset state. por = 1 brownout detection disabled during stop mode. no reset is generated. brownout detection disabled. por level causes reset. v por internal reset stop mode figure 2. brownout reset to 0, meaning that the MAXQ3183 always switches to the high-frequency clock before it begins accepting commands in initialization mode. when an external reset occurs from stop mode, execu- tion (in initialization mode) resumes after 128 cycles of the internal rc oscillator (or approximately 128s). power-on reset when the MAXQ3183 is first powered up, or when thepower supply, v dvdd , drops below the v rst power-fail trip point (outside of stop mode), the MAXQ3183 isheld in power-on reset. once the power supply rises above the v rst level, the power-on reset state is released and all registers are reset to their defaults andexecution resumes in initialization mode. the high-fre- quency external crystal (lowpm = 0) is always select- ed as the clock source following any power-on or brownout reset. in stop mode brownout detection is disabled, so a power-on reset does not occur until v dvdd drops to a lower level (v por ). from the masters perspective, power-on resets and brownout resets both cause theMAXQ3183 to reset in the same way. watchdog reset the MAXQ3183 includes a hardware watchdog timer thatis armed and periodically reset automatically during nor- mal operation. under normal circumstances, the MAXQ3183 always resets the watchdog timer often enough to prevent it from expiring. however, if an internal error of some kind causes the MAXQ3183 to lock up or enter an endless execution loop, the watchdog timer expires and triggers an automatic hardware reset. there is no register flag to indicate to the master that a watch- dog reset has occurred, but the reset line strobes low briefly.the watchdog timer does not run during stop mode. software reset the master initiates a software reset by setting theswres (opmode0.3) bit to 1. when a software reset occurs, the MAXQ3183 clears all registers to their default states and returns to initialization mode, in the downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 18 ______________________________________________________________________________________ same manner as if an external reset had taken place.unlike a hardware reset, however, a software reset does not cause the MAXQ3183 to drive the reset line low. power-supply monitoring in addition to the hardware reset provided by thepower-on reset and brownout reset circuits, the MAXQ3183 includes the capability to detect a low power supply on the dvdd pin and alert the master through the interrupt ( irq ) mechanism before a hard- ware reset occurs. this function, which is alwaysenabled outside of stop mode, causes the ram status register flag pwrf (irq_flag.0) to be set to 1 when- ever v dvdd drops below the v pfw trip point. once pwrf has been set to 1 by hardware, it can only becleared by the master (or by a system reset). whenever pwrf = 1, if the epwrf interrupt masking bit is also set to 1, the MAXQ3183 drives irq low to signal to the master that an interrupt condition (in this case, a power-fail warning) exists and requires attention. clock sources all operations including adc sampling and spi com-munications are synchronized to a single system clock. this clock can be obtained from any one of three selec- table sources, as shown in figure 3. external high-frequency crystal the default system clock source for the MAXQ3183 isan external high-frequency crystal oscillator circuit con- nected between xtal1 and xtal2. when clocked with an external crystal, a parallel-resonant, at-cut crystal oscillating in the fundamental mode is required. when using a high-frequency crystal, the fundamental oscillation mode of the crystal operates as inductive reactance in parallel resonance with external capaci- tors c1 and c2. the typical values of these external capacitors vary with the type of crystal being used and should be selected based on the load capacitance as suggested by the crystal manufacturer. since noise at xtal1 and xtal2 can adversely affect device timing, the crystal and capacitors should always be placed as close as possible to the xtal1 and xtal2 pins, with connection traces between the crystal and the device kept as short and direct as possible. in multiple layer boards, avoid running other high-speed digital signals underneath the crystal oscillator circuit if possible, as this could inject unwanted noise into the clock circuit. following power-up or any system reset, the high-fre- quency clock is automatically selected as the system clock source. however, before this clock can be used xtal in ring in system clock extclk stopm por clk enable watchdog reset ring count int/ext crystal startup timer watchdog timer 1mhz internal oscillator hf crystal glitch-free mux enable clock generation figure 3. simplified clock sources downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 19 for system execution, a crystal warmup timer mustcount 65,536 cycles of the high-frequency clock. while this warmup time period is in effect, execution contin- ues using the internal 1mhz oscillator. once the 65,536-cycle count completes (which requires approxi- mately 8.2ms at 8mhz), the device automatically switches over to the high-frequency clock. this crystal warmup timer is also activated upon exit from stop mode, since the high-frequency crystal oscillator is shut down during stop mode. external high-frequency clock instead of using a crystal oscillator to generate thehigh-frequency clock, it is also possible to input a high- frequency clock that has been generated by another source (such as a digital oscillator ic) directly into the xtal1 pin of the MAXQ3183. to use an external high-frequency clock as the system clock source, the xtal1 pin should be used as the clock input and the xtal2 pin should be left uncon- nected. the master should also shut down the internal crystal oscillator circuit by setting the extclk bit (opmode0.4) to 1. this bit is only cleared by the MAXQ3183 if a power-on or brownout reset occurs and is unaffected by other resets. when using an external high-frequency clock, the clock signal should be generated by a cmos driver. if the clock driver is a ttl gate, its output must be connected to dvdd through a pullup resistor to ensure that the correct logic levels are generated. to minimize system noise in the clock circuitry, the external clock source must meet the maximum rise and fall times and the minimum high and low times specified for the clock source in the electrical characteristics table. internal rc oscillator when the external high-frequency crystal is warmingup, or when the MAXQ3183 is placed into lowpm mode, the system clock is sourced from an internal rc oscillator. this internal oscillator is designed to provide the system approximately 1mhz, although the exact frequency varies over temperature and supply voltage. if no external crystal circuit or high-frequency clock will be used, the MAXQ3183 can be forced to operate infi- nitely from the internal oscillator by grounding xtal1. this ensures that the crystal warmup count never com- pletes, so the MAXQ3183 runs from the internal oscilla- tor in all active modes. master communications before the MAXQ3183 can begin performing electric-metering operations, the master must initialize a num- ber of configuration parameters. since the MAXQ3183 does not contain internal nonvolatile memory, these parameters (stored in internal registers) must be set by the master each time a power-up or reset cycle occurs, or each time a switch is made between lowpm mode and run mode. the external master communicates with the MAXQ3183 over a standard spi bus, using commands to read and write values to internal registers on the MAXQ3183. these registers include, among many other items: ? operating mode settings (stop mode, lowpm mode, external clock mode, etc.) ? status and interrupt flags (power-supply failure, over- current/overvoltage detection, etc.) ? masking control for interrupts to determine which conditions cause irq to be driven low ? configuration settings for analog channel scanning ? power pulse output configuration ? filter coefficients and configuration ? read-only registers containing accumulated power and energy data as the MAXQ3183 obtains voltage and current mea-surements in run mode or lowpm mode, it accumu- lates, filters, and performs a number of calculations on the collected data. many of these operations (including the various filtering stages) are configured by settings in registers written by the master. the output results can then be read by the master from various read-only registers in parallel with the ongoing measurement and processing operations. spi communications rate and format the spi is an interdevice bus protocol that providesfast, synchronous, full-duplex communications between a designated master device and one or more slave devices. in a MAXQ3183-based design, the MAXQ3183 would be the slave device connected to a designated master microcontroller. the external master initiates all communications trans- fers. the interrupt request line irq , while not technical- ly part of the spi bus interface, is also used formaster/slave communications because it allows the MAXQ3183 to notify the master that an interrupt condi- tion exists. some spi peripherals sacrifice speed in favor of simulating a half-duplex operation. this is not the case with the MAXQ3183; it is truly a full-duplex spi slave. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 20 ______________________________________________________________________________________ during an spi transfer, data is simultaneously transmit-ted and received over two serial data lines (miso and mosi) with respect to a single serial shift clock (sclk). the polarity and phase of the serial shift clock are the primary components in defining the spi data transfer format. the polarity of the serial clock corresponds to the idle logic state of the clock line and, therefore, also defines which clock edge is the active edge. to define a serial shift clock signal that idles in a logic-low state (active clock edge = rising), the clock polarity select (ckpol; r_spicf.0) bit should be configured to a 0, while setting ckpol = 1 causes the shift clock to idle in a logic-high state (active clock edge = falling). the phase of the serial clock selects which edge is used to sample the serial shift data. the clock phase select (ckpha; r_spicf.1) bit controls whether the active or inactive clock edge is used to latch the data. whenckpha is set to a logic 1, data is sampled on the inac- tive clock edge (clock returning to the idle state). when ckpha is set to a logic 0, data is sampled on the active clock edge (clock transition to the active state). together, the ckpol and ckpha bits allow four possi- ble spi data transfer formats. transfers over the spi interface always start with the most significant bit and end with the least significant bit. all spi data transfers to and from the MAXQ3183 are always 8 bits (one byte) in length. the MAXQ3183 spi interface does not support 16-bit character lengths. the default format (upon power-up or system reset) for the MAXQ3183 spi interface is represented in figure 4a (ckpol = 0; ckpha = 0). in this format, the sclk cycle # (for reference) sclk (ckpol = 0)sclk (ckpol = 1) mosi (from master) miso (from slave) ssel (to slave) 1 msb 6 5 4 3 2 1 lsb 2 3 4 5 6 7 8 6 msb *not defined but normally msb of character just received. 5 4 3 2 1 lsb * 1 msb 6 5 4 3 2 1 lsb 2 3 4 5 6 7 8 msb * *not defined but normally lsb of previously transmitted character. 6 5 4 3 2 1 lsb sclk cycle # (for reference) sclk (ckpol = 0)sclk (ckpol = 1) mosi (from master) miso (from slave) ssel (to slave) figure 4b. spi interface timing (ckpha = 1) figure 4a. spi interface timing (ckpha = 0) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 21 spi clock idle state is low, and data is shifted in and outon the rising edge of sclk. once spi communication with the MAXQ3183 has been established, it is possible to alter the ckpol and ckpha format settings (as well as changing the ssel signal from active low to active high) if desired by writing to the r_spicf mirror registerand then reading from the special command register upd_sfr to copy the r_spicf value into the internal spi configuration register. whenever the active clock edge is used for sampling (ckpha = 0), the transfer cycle must be started with assertion of the ssel signal. this requirement means that the ssel signal be deasserted and reasserted between successive transfers. conversely, when theinactive edge is used for sampling (ckpha = 1), the ssel signal may remain low through successive transfers, allowing the active clock edge to signal thestart of a new transfer. the clock rate used for the spi interface is determined by the bus master, since the MAXQ3183 always oper- ates as an spi slave device. however, the maximum clock rate is limited by the system clock frequency of the MAXQ3183. for proper communications operation, the spi clock frequency used by the master must be less than or equal to the MAXQ3183s clock frequency divided by 4. for example, when the MAXQ3183 is run- ning at 8mhz, the spi clock frequency must be 2mhz or less. and if the MAXQ3183 is running in lowpm mode (or if the crystal is still warming up), the spi clock frequency must remain at 250khz or less for proper communications operation. in addition to limiting the overall spi bus clock rate, the master must also include a communications delay fol- lowing each byte transmit/receive cycle. this delay, which provides the MAXQ3183 with time to process an adc sample, should be a minimum of 400 system clocks. with default settings and running at 8mhz, this delay time is 50s. reducing the system clock frequen- cy to 1mhz (lowpm mode) would increase this delay period by a factor of 8 to 400s. spi communications protocol all transactions between the master and theMAXQ3183 consist of the master writing to or reading from one of the MAXQ3183s registers. to the host, the MAXQ3183 looks like a memory array that consists of both ram and rom. this is because the rom firmware in the MAXQ3183 reads its operational parameters from ram and places its results in ram. consequently, con- figuring a MAXQ3183 is as simple as performing a block write to its ram locations. some read-only memory locations in the MAXQ3183trigger actions within the device to calculate electricity- metering results on the fly. the specific function and purpose of ram and virtual rom locations are given in the register map. there are several different categories of internal registers on the MAXQ3183. ? ram registers. the values of these registers are stored in the internal ram of the MAXQ3183. somecan be read and written by the master, while others are read-only. ram registers are either 2 or 4 bytes long (16 or 32 bits), although in some registers not all the bits have defined values. read/write registers are generally either status/flag registers (which can be written by either the MAXQ3183 or the master), con- figuration registers (which are written by the master and read by the MAXQ3183 firmware), or data regis- ters (which are read-only and are written by the MAXQ3183 firmware and read by the master). ? virtual registers. these read-only registers are not stored in ram; instead, they contain values that arecalculated on the fly by the MAXQ3183 firmware when the master reads them. these registers are used by the master to obtain values such as phase a, b, and c active, reactive, and apparent power; power factor; and rms voltage and current, which are calculated from currently collected data on an as-needed basis. most virtual registers are 8 bytes in length. ? hardware registers. these registers control core functions of the MAXQ3183 including the adc andthe spi slave bus controller. each of these registers (r_acfg, r_adcrate, r_adcacq, r_spicf, and opmode0 (bit 4, extclk only)) has a register loca- tion in ram that shadows the value of the hardware register. to read from a hardware register, the mas- ter must first read from the special command register upd_mir (a00h) to copy the values from the hard- ware registers to the mirror registers in ram, and then the mirror register in ram can be read. to write to a hardware register, the master reverses the process by writing to the mirror ram register and then reading from the special command register upd_sfr (900h) to copy the values from the mirror registers to the hardware registers. ? special command registers. these registers (upd_sfr and upd_mir) do not return meaningfuldata when read but instead trigger an operation. reading upd_sfr causes values to be copied from the mirror registers to hardware, and reading upd_mir causes values to be copied from the hard- ware to mirror registers. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 22 ______________________________________________________________________________________ every defined register on the MAXQ3183 has a 12-bitaddress (from 0 to 4095). this address is used when addressing the register for either a read or write opera- tion. addresses 0 to 1023 (000h to 3ffh) are used to address ram registers. registers with addresses from 1024 to 4095 (400h to fffh) are used for virtual regis- ters and special command registers. each command consists of a read/write command code, a data length (1, 2, 4, or 8 bytes), a 12-bit regis- ter address, and the specified number of data bytes fol- lowed optionally by a cyclic redundancy check (crc). since spi is a full-duplex interface, the master and slave must both transmit the same number of bytes dur- ing the command. when a multiple-byte register is read or written (2/4/8 byte length), the least significant byte is read or written first in the command. every transaction begins with the master sending 2 bytes that contain the command (read or write), the address to access, and the number of bytes to transfer. every spi peripheral must return 1 byte for every byte it receives. if the master is reading 1 or more bytes from the MAXQ3183, it must send dummy bytes during the cycles when it is receiving a multibyte response to arequest, meeting the send a byte to get a byte require- ment. but the MAXQ3183 could require time to calculate the result, and thus might not have it ready when the master sends the dummy byte. for this reason, the MAXQ3183 always sends zero or more bytes of a nak character (0x4e or ascii n) followed by an ack char- acter (0x41, or ascii a) before sending the data. if the master is writing 1 or more bytes, it sends the data to be written immediately after sending the com- mand. the MAXQ3183 returns ack (0x41) for each data byte. it then returns nak (0x4e) until the write cycle is complete, after which it returns a final ack. immediately after the final ack, the MAXQ3183 is ready to begin the next transaction; there is no need to wait for any other event. it is not even necessary to tog- gle ssel to begin the next transaction. the MAXQ3183 knows that the first transaction is over and is ready forthe next. if, for whatever reason, it is necessary to reset the com- munications between the host and the MAXQ3183 (for table 1. command format for spi register read byte transfers bit description 7:6 command code: 00 read 01 reserved 10 write 11 reserved 5:4 data length: 00 1 byte 01 2 bytes 10 4 bytes 11 8 bytes 1st byte master sends command; slave sends 0xc1 byte 3:0 msb portion of data address. 2nd byte master sends address; slave sends 0xc2 byte 7:0 lsb portion of data address. sync bytes master sends dummy; slave sends ack (0x41) or nack (0x4e) byte 7:0 master sends dummy byte; slave responds with nack if busy, or with ack when processing complete. master must receive ack, then receive data. 3rd byte (1st data byte) master sends dummy; slave sends data 7:0 data, lsb ... ... ... ... nth byte (last data byte) master sends dummy; slave sends data 7:0 data, msb (n + 1) byte master sends dummy; slave sends crc 7:0 optional crc downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 23 table 2. command format for spi register write byte transfers bit description 7:6 command code: 00 read 01 reserved 10 write 11 reserved 5:4 data length: 00 1 byte 01 2 bytes 10 4 bytes 11 8 bytes 1st byte master sends command; slave sends 0xc1 byte 3:0 msb portion of data address. 2nd byte master sends address; slave sends 0xc2 byte 7:0 lsb portion of data address. 3rd byte (1st data byte) master sends data; slave sends ack (0x41) 7:0 data, lsb ... ... ... ... nth byte (last data byte) master sends data; slave sends ack (0x41) 7:0 data, msb (n + 1) byte master sends crc; slave sends ack (0x41) 7:0 optional crc sync bytes master sends dummy; slave sends ack (0x41) or nack (0x4e) byte 7:0 master sends dummy byte; slave responds with nack if busy, or with ack when processing complete. master must receive ack before starting the next transaction. example, if synchronization is lost), the host only needsto wait for the spi to time out before restarting commu- nication from the first command byte. spi timeout count starts after receiving the first command byte from the master (after the 8th spi clock of the first byte). the count stops and clears after receiving the last byte of a transaction (after the 8th spi clock of the last byte). if the timeout count expires (exceeds com_timo) before the transaction completes, the MAXQ3183 aban- dons the unfinished transaction and resets the spi logic to be ready for the next transaction. the default spi timeout is 360ms. optionally, a crc byte can be appended to each transaction. for write commands, the crc byte is sent by the master, and for read commands the crc byte is sent by the MAXQ3183. the crc mode is enabled when the crcen bit is set to 1 in opmode1 register. otherwise, the MAXQ3183 assumes no crc byte is used. the 8-bit crc is calculated for all bytes in a transaction, from the first command byte sent by the master through the last data byte excluding sync bytes,using the polynomial p = x 8 + x 5 + x 4 + 1. if the trans- mitted crc byte does not match the calculated crcbyte (for a write command), the MAXQ3183 ignores the command. the length of the transfer is defined by the first com- mand byte and the status of the crcen bit in the opmode1 register. there is no special synchronization mechanism provided in this simple protocol. therefore, the master is responsible for sending/receiving the cor- rect number of bytes. if the master mistakenly sends more bytes than are required by the current command, the extra bytes are either ignored (if the MAXQ3183 is busy processing the previous command) or are inter- preted as the beginning of a new command. if the mas- ter sends fewer bytes than are required by the current command, the MAXQ3183 waits for spi timeout, then drops the transaction and resets the communication channel. the duration of the timeout can be configured through the com_timo register. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 24 ______________________________________________________________________________________ figures 5 and 6 show typical 2-byte reading and writingtransfers (without crc byte). host software design individual message bytes sent through the spi areprocessed in a software routine contained in the rom firmware. for this reason, it is necessary to provide a delay between successive bytes. this byte spacing must be no less than 400 system clocks to ensure that the MAXQ3183 has a chance to read and process the byte before the arrival of the next one. it is strongly rec- ommended that crc be enabled for both read and write to achieve reliable operations. register set data and device command and control information arelocated in internal registers. registers range from 8 to 64 bits in length and are divided into ram-based registers and virtual registers. the ram-based registers containboth operating parameters and measurement results. to read any virtual power registers, the host must first confirm that the dsprdy bit of the irq_flag register is set, which indicates the last dsp cycle has complet- ed, then proceed to reading all the desired virtual power registers. for best communication efficiency, it is recommended to complete reading the virtual power registers before reading other registers. virtual power register reads must be completed within 50% of dsp cycle time, from the moment dsprdy bit is set. do not forget to clear the dsprdy bit, otherwise, host software is not able to detect the completion of the new dsp cycle. the MAXQ3183 does not clear the bit; it only sets the bit whenever a dsp cycle processing is com- pleted. users can clear the bit directly after the confir- mation that the bit is set. clearing the dsprdy bit does not affect the dsp processing. ssel sclkmosi miso reading data from MAXQ3183 through spi interface 00 01 address dummy dummy dummy dummy 0xc1 0xc2 nack (0x4e) data lsb data msb ack (0x41) ssel sclkmosi miso 10 01 address dummy dummy 0xc1 0xc2 ack (0x41) nack (0x4e) ack (0x41) ack (0x41) writing data to MAXQ3183 through spi interface data lsb data msb figure 6. write spi transfer figure 5. read spi transfer downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 25 read MAXQ3183 send command byte 1 get 0xc1?get 0xc2? exit spi timeout (360ms) delay > 400 sysclk send command byte 2 send 0x00 delay > 400 sysclk send 0x00 get data byte delay > 400 sysclk get 0x4e? get 0x41? done? n n n y n write MAXQ3183 send command byte 1 get 0xc1?get 0xc2? exit spi timeout (360ms) delay > 400 sysclk send command byte 2 send data byte delay > 400 sysclk send 0x00 delay > 400 sysclk get 0x4e? get 0x41? done? get 0x41? n n n n y n figure 8. flowchart for writing to MAXQ3183 figure 7. flowchart for reading from MAXQ3183 the virtual registers contain calculated values derivedfrom one or more real registers. they are calculated at the time they are requested, and thus can involve addi- tional time to return a value. most virtual registers are 8bytes in length and are delivered least significant byte first. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 26 ______________________________________________________________________________________ table 3. ram register map 0h 1h 2h 3h 4h 5h 6h 7h 8h 9h ah bh ch dh eh fh 0x00 status op mode0 op mode1 op mode2 irq_flag irq_mask scan _ia scan _va scan _ic scan _vc scan _ib scan _vb scan _in scan _te 0x01 aux_cfg sys_khz volt_cc amp_cc pwr_cc enr_cc cycnt plscfg 1 plscfg 2 0x02 pls1_wd thr1 pls2_wd thr2 rej_ns avg_ns 0x03 avg_c hpf_c b0fund a1fund b0harm a1harm 0x04 ns oclvl ovlvl uvlvl noload r_acfg r_adcrate 0x05 r_adcacq r_ spicf isumlvl com_timo acc_timo zc_lpf i1thr i2thr 0x06 temp_cc linefr chksum 0 x 1 1 n . i r m s 0 x 1 2 n . i _ g a i n phase a calibration and status registers 0x13 a.i_gain a.v_gain a.e_gain a.ef_gain a.offs_hi a.gain _lo a.offs_lo a.pa0 0x14 a.pa1 a.pa2 a. flags a. mask a. eover a. efover phase b calibration and status registers 0x21 b.i_gain b.v_gain 0x22 b.e_gain b.ef_gain b.offs_hi b.gain_lo b.offs_lo b.pa0 b.pa1 b.pa2 0x23 b. flags b. mask b. eover b. efover phase c calibration and status registers 0x30 c.i_gain c.v_gain c.e_gain c.ef_gain 0x31 c.offs_hi c.gain_lo c.offs_lo c.pa0 c.pa1 c.pa2 c. flags c. mask c. eover c. efover 0x32 phase a measurement registers* 0x1c a.pf a.vrms a.irms 0x1d a.act a.rea a.app a.actf 0x1e a.reaf a.appf a.eapos a.eaneg 0x1f a.erpos a.erneg a.es a.eafpos 0x20 a.eafneg a.erfpos a.erfneg a.esf phase b measurement registers* 0x2b b.pf b.vrms b.irms b.act 0x2c b.rea b.app b.actf b.reaf 0x2d b.appf b.eapos b.eaneg b.erpos 0x2e b.erneg b.es b.eafpos b.eafneg 0x2f b.erfpos b.erfneg b.esf phase c measurement registers* 0x39 c.pf 0x3a c.vrms c.irms c.act c.rea 0x3b c.app c.actf c.reaf c.appf 0x3c c.eapos c.eaneg c.erpos c.erneg 0x3d c.es c.eafpos c.eafneg c.erfpos 0 x 3 e c . e r f n e g c . e s f * read-only. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 27 0 1 2 3 4 7 9 a c 0x80 pwrp.a pwrp.b pwrp.c pwrp.t 0x81 pwrq.a pwrq.b pwrq.c pwrq.t 0x82 pwrs.a pwrs.b pwrs.c pwrs.t 0x83 v.harm v.a v.b v.c 0x84 i.n, i.harm i.a i.b i.c 0x85 harm_nf vbph vcph thdn.a thdn.b thdn.c 0x86 pf.t 0x87 enrs.a enrs.b enrs.c enrs.t 0x88 pwrpf.a pwrpf.b pwrpf.c pwrpf.t 0x89 pwrqf.a pwrqf.b pwrqf.c pwrqf.t 0x8a pwrsf.a pwrsf.b pwrsf.c pwrsf.t 0x8b enrsf.a enrsf.b enrsf.c enrsf.t 0x8c enrp.a enrp.b enrp.c enrp.t 0x8d enrq.a enrq.b enrq.c enrq.t 0x8e enrpf.a enrpf.b enrpf.c enrpf.t 0x8f enrqf.a enrqf.b enrqf.c enrqf.t special function registers 0xc0 dspver temp_c enter stop enter lowpm exit lowpm table 4. virtual register map note: all virtual registers are read-only. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 28 ______________________________________________________________________________________ ram-based registers the ram-based registers contain both operating parameters and measurement results. they are divided into a num-ber of categories that are described in the following sections. general operating registers global status register (status) (0x000) this register contains bits that reflect the global status of the device. bit: 7 6 5 4 3 2 1 0 name: croff porf wdtr phseqi phseqv revcfq revcfp reset: 0 0 0 0 0 0 0 0 bit name function 7 reserved. 6 croff when set, the high-frequency crystal has failed and the MAXQ3183 is operat ing from its internal ring oscillator. under these circumsta nces, energy accumulation is not accurate and the spi bus does not operate at full speed. 5 porf when set, the last reset was due to power-on-reset. host s hould clear this bit to allow the next por detection. 4 wdtr when set, the last reset was caused by expired watchdog. the bit shoul d be cleared (set to 0) by the host to allow the next watchdog reset detection. 3 phseqi 0 = the sequence of currents presented to the inputs is (-a-b-c-). 1 = the sequence of currents presented to the inputs is (-a-c-b-). 2 phseqv 0 = the sequence of voltages presented to the voltage inputs is (-a-b -c-). 1 = the sequence of voltages presented to the voltage inputs is rever sed (-a-c-b-). this bit is meaningful only for connection systems that include all three v oltages. 1 revcfq 0 = the quantity being output on the cfq pin is positive (direct). 1 = the quantity being output on the cfq pin is negative (reverse) . 0 revcfp 0 = the quantity being output on the cfp pin is positive (direct). 1 = the quantity being output on the cfp pin is negative (reverse). downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 29 operating mode register 1 (opmode1) (0x002) bit name function 7:4, 1:0 reserved. 3 crcen if set, a 1-byte crc is appended to the end of each spi read and is expected at the end of each spi write. see the spi commnications protocol section for details about how to use the crc byte for error checking on the spi bus. 2 popol this bit sets the polarity of the output pulse generators. if clear, the pu lse outputs are active low; that is, they remain in the high state until a pulse event occurs, at which time they switch low for one pulse-width interval before reverting to the high state. if set, t he pulse outputs are active high; that is, they remain in the low state until a pulse event occurs, at which time they s witch to the high state for one pulse-width interval before reverting to the low state. bit: 7 6 5 4 3 2 1 0 name: crcen popol reset: 0 0 0 0 0 0 0 0 operating mode register 0 (opmode0) (0x001) bit name function 7:5, 0 reserved. 4 extclk when set, the high-frequency crystal osc illator is disabled and the xtal1 pin is configured to be a clock input for the device. this is used when it is desired to operate multiple devices from the same clock source for purposes of maintaining synchronization. 3 swres when set, forces the internal software to restart from the reset vector. this h as the same effect as a power-on reset, but does not specifically reset any hardwar e peripherals. this bit is automatically cleared after the reset. 2 dspdis when set, disables the signal processing software routines. the c pu continues to run at full speed, but only to perform supervisory functions (such as servicing t he spi port). 1 lowpm when set, causes the cpu to switch its clock source from the external crystal to an internal ring osci llator that operates at a nominal frequency of 1mhz. in this mode, the cpu continues to run, but the host must reconfigure the parameters configured for crystal operation (such as filter settings, timeouts, an d pulse widths). bit: 7 6 5 4 3 2 1 0 name: extclk swres dspdis lowpm reset: 0 0 0 0 0 0 0 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 30 ______________________________________________________________________________________ operating mode register 2 (opmode2) (0x003) bit name function 7, 3 reserved. 6 dhara when set, disables automatic determination of the filter parameters for the harmonic filter coefficient. if set by the host software, the host must set a value in the a1harm f ilter coefficient register to establish the operating frequency of this filter if harmonic-mode ca lculations are used. when cleared, the MAXQ3183 automatically determines the value of the harmonic filt er coefficient based on the measured line frequency and the harmonic-order requested (aux_cfg.or dh). 5 dfuna when set, disables automatic determination of the filter parameters for the fundamental-mode filter. if set by the host software, the host must set a value in the a1fund filter coefficient register to establish the operating frequency of this filter if fundamental-mode calculations are used. when clear, the MAXQ3183 automatically determines the value of the fundamental-mode f ilter coefficient based on the measured line frequency. 4 dfun when set, fundamental-mode calculations are disabled. fundamental-mode calcu lations provide information about power and energy that are consumed only at the fundamental line freq uency apart from any harmonics that could be present. setting this bit disables all fundamental frequency registers but allows the MAXQ3183 to calculate other parameters at a higher rate . set this bit when (1) fundamental mode values do not need to be read, and (2) r_adcrate needs to be reduced below its default value. these bits select the coefficient used in calculating apparent powe r. 00 = 1-phase, 3-wire (1p3w), or 3-phase, 4-wire (3p4w) (c = 1) 01 = 3-phase, 3-wire (3p3w) (c =  3/2) 10 = three voltages, three currents (3v3a) (c =  3/3) 2:1 wirsys 3p3w wiring (01) bit: 7 6 5 4 3 2 1 0 name: dhara dfuna dfun wirsys appsel reset: 0 0 0 0 0 0 0 0 i a i c v ab v cb downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 31 operating mode register 2 (opmode2) (0x003) (continued) bit name function 3p4w wiring (00) 3v3a (10) 2:1 wirsys 1p3w (00) selects the mechanism to use for calculating apparent power. 0: s = v rms x i rms apparent power is calculated by multiplying, on a per-dsp cycle ba sis, the product of the rms volts and rms amps. 0 appsel 1: s = p 2 + q 2 apparent power is calculated by finding the length of the power ve ctor. i a i c i b v ab v ac v bc i a n i b v an v bn v i a i b i c v n v b downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 32 ______________________________________________________________________________________ the interrupt request flag register contains bits that indicate the reason the irq pin has become active. the active bit must be cleared by the host to avoid continuing firing of the interrupt by the MAXQ3183. bit name function 15 dspor when set, the dsp was unable to complete processing one cycle when a nother cycle was due to begin. this indicates that the r_adcrate is set too low, and that samples are arriving more quickly than they can be processed. either increase the value of the r_adcrat e register or set the dfun bit in the opmode2 register to disable fundamental frequency calculations to reduce the load on the dsp. 14 dsprdy set when the dsp cycle completes. 13 dchr when set, the direction of reactive energy flow has changed (that i s, from capacitive to inductive or from inductive to capacitive). 12 dcha when set, the direction of real energy flow has changed (that is, from to ward the load to away from the load, or from away from the load to toward the load). 11 nozx when set, the MAXQ3183 has failed to detect zero crossings on one or more vol tage channels in one complete dsp cycle. 10 uv when set, the absolute instantan eous voltage level in one or more voltage channels failed to exceed the trip level set in the uvlvl (undervoltage level) register for one dsp c ycle. 9 ov when set, the absolute instantan eous voltage level in one or more voltage channels has exceeded the trip level set in the ovlvl (overvoltage level) register. 8 oc when set, the absolute instantan eous current in one or more current channels has exceeded the trip level set in the oclvl (overcurrent level) register. 7:4 reserved. 3 isumovf when set, the vector sum of currents (3 or 4) exceeds the threshol d. 2 eovf when set, one or more energy accumulators have an msb overflow condition. 1 chsch when set, indicates a change of the chksum. the chksum is compute d over the configuration and calibration data. the host should review a change in chksum becaus e any change in the configuration or calibration data affects the metering operation and accuracy. 0 pwrf when set, a power-supply failure is immi nent and the supervisory processor should begin taking steps to save its state and prepare for a loss of power. global interrupt registers interrupt request flag register (irq_flag) (0x004) bit: 15 14 13 12 11 10 9 8 name: dspor dsprdy dchr dcha nozx uv ov oc reset: 0 0 0 0 0 0 0 0 bit: 7 6 5 4 3 2 1 0 name: isumovf eovf chsch pwrf reset: 0 0 0 0 0 0 0 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 33 interrupt mask register (irq_mask) (0x006) bit name function 15 edspor when set, the dspor flag causes the irq pin to become active. 14 edsprdy when set, the dsprdy flag causes the irq pin to become active. 13 edchr when set, the dchr flag causes the irq pin to become active. 12 edcha when set, the dcha flag causes the irq pin to become active. 11 enozx when set, the nozx flag causes the irq pin to become active. 10 euv when set, the uv flag causes the irq pin to become active. 9 eov when set, the ov flag causes the irq pin to become active. 8 eoc when set, the oc flag causes the irq pin to become active. 7:4 reserved. 3 eisum when set, the isumovf flag causes the irq pin to become active. 2 eeovf when set, the eovf flag causes the irq pin to become active. 1 echsch when set, the chsch flag enables the irq pin to become active. 0 epwrf when set, the pwrf flag causes the irq pin to become active. bit: 15 14 13 12 11 10 9 8 name: edspor edsprdy edchr edcha enozx euv eov eoc reset: 0 0 0 0 0 0 0 0 bit: 7 6 5 4 3 2 1 0 name: eisum eeovf echsch epwrf reset: 0 0 0 0 0 0 0 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 34 ______________________________________________________________________________________ meter pulse configuration pulse configurationcfp output (plscfg1) (0x01e) this register selects which phases are included in the cfp pulse output and also selects which quantity is accumu-lated to drive the pulse output. bit: 7 6 5 4 3 2 1 0 name: qnsel phasec phaseb phasea reset: 0x0 0 0 0 bit name function 7:3 qnsel cfp pulse output source select. this five-bit field determine s what meter value will be accumulated in each of the phases to produce the cfp pulse output. all other values ar e reserved. 00000 = net real energy 00001 = absolute real energy 00010 = net reactive energy 00011 = absolute reactive energy 00100 = apparent energy 00110 = i rms 00111 = v rms 01000 = real energy delivered to load 01001 = real energy delivered to line 01010 = reactive energy, quadrant i 01011 = reactive energy, quadrant ii 01100 = reactive energy, quadrant iii 01101 = reactive energy, quadrant iv 2 phasec cfp phase c inclusion. when this bit is set, phase c is included in cfp pulse generation. 1 phaseb cfp phase b inclusion. when this bit is set, phase b is included in cfp pulse generation. 0 phasea cfp phase a inclusion. when this bit is set, phase a is included in cfp pulse generation. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 35 pulse configurationcfq output (plscfg2) (0x01f) this register selects which phases are included in the cfq pulse output and also selects which quantity is accumu-lated to drive the pulse output. bit name function 7:3 qnsel cfq pulse output source select. this five-bit field determ ines what meter value is accumulated in each of the phases to produce the cfq pulse output. all other values are reserved. 00000 = net real energy 00001 = absolute real energy 00010 = net reactive energy 00011 = absolute reactive energy 00100 = apparent energy 00110 = i rms 00111 = v rms 01000 = real energy delivered to load 01001 = real energy delivered to line 01010 = reactive energy, quadrant i 01011 = reactive energy, quadrant ii 01100 = reactive energy, quadrant iii 01101 = reactive energy, quadrant iv 2 phasec cfq phase c inclusion. when this bit is set, phase c is included in cfq pulse generation. 1 phaseb cfq phase b inclusion. when this bit is set, phase b is included in cfq pulse generation. 0 phasea cfq phase a inclusion. when this bit is set, phase a is included in cfq pulse generation. bit: 7 6 5 4 3 2 1 0 name: qnsel phasec phaseb phasea reset: 0x0 0 0 0 cfp pulse width (pls1_wd) (0x020) this register designates the width of the cfp pulse, that is, the duration of the period that the cfp pulse is in theactive state. this value is given in adc frame times (about 360s). the default value of 0x9c (156 decimal) provides a pulse width of about 50ms. bit: 15 14 13 12 11 10 9 8 name: cfp pulse-width high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: cfp pulse-width low byte reset: 0x9c downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 36 ______________________________________________________________________________________ cfp pulse threshold (thr1) (0x022) this register designates the threshold of the cfp pulse. this value is used to set the meter constant for the cfppulse output. when the cfp pulse accumulator exceeds the value set in this register, the cfp pulse output is activat- ed and the cfp pulse accumulator is reduced by the amount in this register. cfq pulse width (pls2_wd) (0x026) this register designates the width of the cfq pulse; that is, the duration of the period that the cfq pulse is in theactive state. this value is given in adc frame times (about 360s). the default value of 0x9c (156 decimal) provides a pulse width of about 50ms. bit: 31 30 29 28 27 26 25 24 name: thr1 byte 3 reset: 0x00 bit: 23 22 21 20 19 18 17 16 name: thr1 byte 2 reset: 0x10 bit: 15 14 13 12 11 10 9 8 name: thr1 byte 1 reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: thr1 byte 0 reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: cfq pulse-width high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: cfq pulse-width low byte reset: 0x9c downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 37 cfq pulse threshold (thr2) (0x028) this register designates the threshold of the cfq pulse. this value is used to set the meter constant for the cfqpulse output. when the cfq pulse accumulator exceeds the value set in this register, the cfq pulse output is acti- vated and the cfq pulse accumulator is reduced by the amount in this register. calibration registers current gain, phase x = a/b/c/n (x.i_gain) (a: 0x130, b: 0x21c, c: 0x308, n: 0x12e) this register contains gain coefficient for phase x current channel. the raw values are taken from the selected mea-surement quantity and scaled by the factor: note: bit 15 of this register must be set to zero for correct operation. xi gain ._ 2 14 bit: 31 30 29 28 27 26 25 24 name: thr2 byte 3 reset: 0x00 bit: 23 22 21 20 19 18 17 16 name: thr2 byte 2 reset: 0x10 bit: 15 14 13 12 11 10 9 8 name: thr2 byte 1 reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: thr2 byte 0 reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: current gain coefficient high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: current gain coefficient low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 38 ______________________________________________________________________________________ voltage gain, phase x = a/b/c (x.v_gain) (a: 0x132, b: 0x21e, c: 0x30a) this register contains gain coefficient for phase x voltage channel. the raw values are taken from the selected mea-surement quantity and scaled by the factor: note: bit 15 of this register must be set to zero for correct operation. energy gain, phase x = a/b/c (x.e_gain) (a: 0x134, b: 0x220, c: 0x30c) this register contains gain coefficient for phase x energy. the raw values are taken from the selected measurementquantity and scaled by the factor: note: bit 15 of this register must be set to zero for correct operation. phase-angle compensation, high range, phase x = a/b/c (x.pa0) (a: 0x13e, b: 0x22a, c: 0x316) this signed register contains the angle as a fraction of one radian to add to the measured phase angle when themeasured current is above the value given in i1thr. this signed value ranges from -0.5 radian (at a value of 0x8000) to +(0.5 - 2 -16 ) radian (at a value of 0x7fff). xe gain ._ 2 14 x v gain ._ 2 14 bit: 15 14 13 12 11 10 9 8 name: voltage gain coefficient high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: voltage gain coefficient low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: energy gain coefficient high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: energy gain coefficient low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: phase-angle offset high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: phase-angle offset low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 39 phase-angle compensation, medium range, phase x = a/b/c (x.pa1) (a: 0x140, b: 0x22c, c: 0x318) this signed register contains the angle, as a fraction of one radian, to add to the measured phase angle when themeasured current is between the values given in i1thr and i2thr. this signed value ranges from -0.5 radian (at a value of 0x8000) to +(0.5 - 2 -16 ) radian (at a value of 0x7fff). phase-angle compensation, low range, phase x = a/b/c (x.pa2) (a: 0x142, b: 0x22e, c: 0x31a) this signed register contains the angle, as a fraction of one radian, to add to the measured phase angle when themeasured current is below the value given in i2thr. this signed value ranges from -0.5 radian (at a value of 0x8000) to +(0.5 - 2 -16 ) radian (at a value of 0x7fff). limit registers overcurrent level (oclvl) (0x044) this register specifies the fraction of full-scale current that is declared to be an overcurrent condition. when x.irmsexceeds this level for one dsp cycle, the ocf flag in the x.flags register is set. if the ocm flag is set in the x.mask register, setting the ocf flag will cause the interrupt bit oc to be set in the irq_flag register. if the inter- rupt is enabled, the interrupt pin is driven active. full scale is represented by 0x10000. the maximum value for this register is 0xffff. bit: 15 14 13 12 11 10 9 8 name: phase-angle offset high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: phase-angle offset low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: phase-angle offset high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: phase-angle offset low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: overcurrent level high byte reset: 0xff bit: 7 6 5 4 3 2 1 0 name: overcurrent level low byte reset: 0xff downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 40 ______________________________________________________________________________________ overvoltage level (ovlvl) (0x046) this register specifies the fraction of full-scale voltage that is declared to be an overvoltage condition. when x.vrmsexceeds this level for one dsp cycle, the ovf flag in the x.flags register is set. if the ovm flag is set in the x.mask register, setting the ovf flag will cause the interrupt bit ov to be set in the irq_flag register. if the inter- rupt is enabled, the interrupt pin is driven active. full scale is represented by 0x10000. the maximum value for this register is 0xffff. undervoltage level (uvlvl) (0x048) this register specifies the fraction of full-scale voltage below which an undervoltage condition is declared. whenx.vrms falls below this level for one dsp cycle, the uvf flag in the x.flags register is set. if the uvm flag is set in the x.mask register, setting the uvf flag will cause the interrupt bit uv to be set in the irq_flag register. if the interrupt is enabled, the interrupt pin is driven active. full scale is represented by 0x10000. the maximum value for this register is 0xffff. no-load level (noload) (0x04a) this register specifies the fraction of full-scale current below which a no-load condition is declared. when x.irmsfalls below this level, the MAXQ3183 no longer accumulates power for phase x. full scale is represented by 0x10000. the maximum value for this register is 0xffff. bit: 15 14 13 12 11 10 9 8 name: overvoltage level high byte reset: 0xff bit: 7 6 5 4 3 2 1 0 name: overvoltage level low byte reset: 0xff bit: 15 14 13 12 11 10 9 8 name: undervoltage level high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: undervoltage level low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: no-load level high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: no-load level low byte reset: 0x03 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 41 current vector sum threshold (isumlvl) (0x054) this register specifies the threshold value for the vector sum (of three phase currents or three phase currents plusthe neutral current, configurable in the aux_cfg register) as a fraction of the full-scale current. when the vector sum (rms) value exceeds this threshold value in one dsp cycle, the isumovf flag in the irq_flag register is set. if the irq_mask.eisum bit is set, the interrupt pin is driven active. the host must clear the interrupt flag. full scale is rep- resented by 0x10000. the maximum value allowed is 0xffff. phase status registers interrupt flags, phase x = a/b/c (x.flags) (a: 0x144, b: 0x230, c: 0x31c) the x.flags register contains condition flags that relate to the function of phase x (a/b/c) measurements. onceset, these bits can be cleared only by the host. bit: 7 6 5 4 3 2 1 0 name: dchrf dchaf nozxf uvf ovf ocf reset: 0 0 0 0 0 0 0 0 bit name function 7:6 reserved. 5 dchrf reactive energy direction change. set when the direction of reactive power flow changes (from capacitive to inductive or from inductive to capacitive). if the dchr m bit is set, this bit sets the dchr flag in the irq_flag register. 4 dchaf real energy direction change. set when the direction of real power flow changes (fr om toward the load to toward the line, or from toward the line to toward the load). if the dcham bit is set, thi s bit sets the dcha flag in the irq_flag register. 3 nozxf no-zero crossing. set when the voltage waveform in phase x fails to ex hibit a zero crossing during one dsp cycle. if the nozxm bit is set, this bit sets the nozx flag in the ir q_flag register. 2 uvf undervoltage. set when the rms voltage in phase x falls below the undervoltage threshold set in uvlvl. if the uvm bit is set, this bit sets the uv flag in the irq_flag re gister. 1 ovf overvoltage. set when the rms voltage in phase x exceeds the overvol tage threshold set in ovlvl. if the ovm bit is set, this bit sets the ov flag in the irq_flag reg ister. 0 ocf overcurrent. set when the rms current in phase x exceeds the overcurrent thresh old set in oclvl. if the ocm bit is set, this bit sets the oc flag in the irq_flag registe r. bit: 15 14 13 12 11 10 9 8 name: vector sum threshold high byte reset: 0xff bit: 7 6 5 4 3 2 1 0 name: vector sum threshold low byte reset: 0xff downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 42 ______________________________________________________________________________________ interrupt mask, phase x = a/b/c (x.mask) (a: 0x145, b: 0x231, c: 0x31d) energy overflow flags, phase x = a/b/c (x.eover) (a: 0x146, b: 0x232, c: 0x31e) these bits indicate that an overflow condition has occurred on an energy accumulator. an overflow condition is not an error condition. rather, it simply indicates that the value in the energy accumulator could be smaller than the pre-vious reading due to the overflow in the counter. to obtain the actual energy usage since the previous reading, 0x100000000 must be added to the difference. these bits, once set, can be cleared only by the host. bit: 7 6 5 4 3 2 1 0 name: dir_r dir_a dchrm dcham nozxm uvm ovm ocm reset: 0 0 0 0 0 0 0 0 bit name function 7 dir_r reactive energy direction status 0 = positive 1 = negative 6 dir_a active energy direction status 0 = positive 1 = negative 5 dchrm reactive energy direction change mask. if set, a change in reactive power direction on p hase x causes the dchr flag in the irq_flag register to be set. 4 dcham real energy direction change mask. if set, a change in real power direction on phase x causes the dcha flag in the irq_flag register to be set. 3 nozxm no-zero crossing mask. if set, a no-zero crossing on phase x causes the noz x flag in the irq_flag register to be set. 2 uvm undervoltage mask. if set, an undervoltage condition on phase x causes the uv flag in t he irq_flag register to be set. 1 ovm overvoltage mask. if set, an overvoltage condition on phase x causes the ov flag in the irq_flag register to be set. 0 ocm overcurrent mask. if set, an overcurrent condition on phase x causes the oc flag in the irq_flag register to be set. bit name function 7:5 reserved. 4 sov when set, indicates an overflow condition on the apparent energy accumulator. 3 rnov when set, indicates an overflow condition on the reactive negative energy accumulator. 2 rpov when set, indicates an overflow condition on the reactive positive energy accumulator. 1 anov when set, indicates an overflow condition on the real negative energy accumulator. 0 apov when set, indicates an overflow condition on the real positive energy accumulator. bit: 7 6 5 4 3 2 1 0 name: sov rnov rpov anov apov reset: 0 0 0 0 0 0 0 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 43 measurements line frequency (linefr) (0x062) line frequency, lsb = 0.001hz. power factor, phase x = a/b/c (x.pf) (a: 0x1c6, b: 0x2b2, c: 0x39e) power factor of phase a/b/c, lsb = 1/2 14 . note that the power factors are signed integers, and a negative value indicates a reversed power flow direction. rms voltage, phase x = a/b/c (x.vrms) (a: 0x1c8, b: 0x2b4, c: 0x3a0) this register provides the raw rms voltage over the most recent dsp cycle, lsb = v fs /2 24 . bit: 15 14 13 12 11 10 9 8 name: line frequency high byte reset: bit: 7 6 5 4 3 2 1 0 name: line frequency low byte reset: bit: 15 14 13 12 11 10 9 8 name: power factor high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: power factor low byte reset: 0x00 bit: 31 30 29 28 27 26 25 24 name: rms voltage byte 3 bit: 23 22 21 20 19 18 17 16 name: rms voltage byte 2 bit: 15 14 13 12 11 10 9 8 name: rms voltage byte 1 bit: 7 6 5 4 3 2 1 0 name: rms voltage byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 44 ______________________________________________________________________________________ rms current, phase x = a/b/c (x.irms) (a: 0x1cc, b: 0x2b8, c: 0x3a4) this register provides the raw rms current over the most recent dsp cycle, lsb = i fs /2 24 . energy, real positive, phase x = a/b/c (x.eapos) (a: 0x1e8, b: 0x2d4, c: 0x3c0) on every dsp cycle, the contents of the x.act register are tested, and, if positive, are added to this register. whenthis register overflows, the apov bit in the x.eover register is set. bit: 31 30 29 28 27 26 25 24 name: rms current byte 3 bit: 23 22 21 20 19 18 17 16 name: rms current byte 2 bit: 15 14 13 12 11 10 9 8 name: rms current byte 1 bit: 7 6 5 4 3 2 1 0 name: rms current byte 0 bit: 31 30 29 28 27 26 25 24 name: real energy byte 3 bit: 23 22 21 20 19 18 17 16 name: real energy byte 2 bit: 15 14 13 12 11 10 9 8 name: real energy byte 1 bit: 7 6 5 4 3 2 1 0 name: real energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 45 energy, real negative, phase x = a/b/c (x.eaneg) (a: 0x1ec, b: 0x2d8, c: 0x3c4) on every dsp cycle, the contents of the x.act register are tested, and, if negative, absolute values are added tothis register. when this register overflows, the anov bit in the x.eover register is set. energy, reactive positive, phase x = a/b/c (x.erpos) (a: 0x1f0, b: 0x2dc, c: 0x3c8) on every dsp cycle, the contents of the x.rea register are tested, and, if positive, are added to this register. whenthis register overflows, the rpov bit in the x.eover register is set. bit: 31 30 29 28 27 26 25 24 name: real energy byte 3 bit: 23 22 21 20 19 18 17 16 name: real energy byte 2 bit: 15 14 13 12 11 10 9 8 name: real energy byte 1 bit: 7 6 5 4 3 2 1 0 name: real energy byte 0 bit: 31 30 29 28 27 26 25 24 name: reactive energy byte 3 bit: 23 22 21 20 19 18 17 16 name: reactive energy byte 2 bit: 15 14 13 12 11 10 9 8 name: reactive energy byte 1 bit: 7 6 5 4 3 2 1 0 name: reactive energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 46 ______________________________________________________________________________________ energy, reactive negative, phase x = a/b/c (x.erneg) (a: 0x1f4, b: 0x2e0, c: 0x3cc) on every dsp cycle, the contents of the x.rea register are tested, and, if negative, absolute values are added tothis register. when this register overflows, the rnov bit in the x.eover register is set. energy, apparent, phase x = a/b/c (x.es) (a: 0x1f8, b: 0x2e4, c: 0x3d0) on every dsp cycle, the contents of the x.app register are added to this register. when this register overflows, thesov bit in the x.eover register is set. bit: 31 30 29 28 27 26 25 24 name: reactive energy byte 3 bit: 23 22 21 20 19 18 17 16 name: reactive energy byte 2 bit: 15 14 13 12 11 10 9 8 name: reactive energy byte 1 bit: 7 6 5 4 3 2 1 0 name: reactive energy byte 0 bit: 31 30 29 28 27 26 25 24 name: apparent energy byte 3 bit: 23 22 21 20 19 18 17 16 name: apparent energy byte 2 bit: 15 14 13 12 11 10 9 8 name: apparent energy byte 1 bit: 7 6 5 4 3 2 1 0 name: apparent energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 47 virtual register conversion coefficients voltage units conversion coefficient (volt_cc) (0x014) this register contains the value by which the raw voltage value in each phase (a.vrms, b.vrms, and c.vrms) ismultiplied before being presented to the virtual rms voltage registers (v.a, v.b, and v.c). to determine the value of volt_cc, a voltage value for the least significant bit (volt_lsb) of the v.x registers must be selected. typical values might range from 1mv to 1nv. to avoid significant conversion loss, volt_lsb should be chosen such that volt_cc is >1000. once volt_lsb is determined, calculate volt_cc from the following equa- tion: current units conversion coefficient (amp_cc) (0x016) this register contains the value by which the raw current value in each phase (a.irms, b.irms, c.irms, andn.irms) is multiplied before being presented to the virtual rms current registers (i.a, i.b, i.c, and i.n). to determine the value of amp_cc, a current value for the least significant bit (amp_lsb) of the i.x registers must be selected. typical values might range from 1na to 10a. to avoid significant conversion loss, amp_lsb should be chosen such that amp_cc is >1000. once determined, calculate amp_cc from the following equation: amp cc i amp lsb fs _ _ = 2 24 volt cc v volt lsb fs _ _ = 2 24 bit: 15 14 13 12 11 10 9 8 name: voltage units conversion coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: voltage units conversion coefficient low byte reset: 0x01 bit: 15 14 13 12 11 10 9 8 name: current units conversion coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: current units conversion coefficient low byte reset 0x01 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 48 ______________________________________________________________________________________ power units conversion coefficient (pwr_cc) (0x018) this register contains the value by which the raw power value in each phase is multiplied before being presented tothe virtual power registers. the table below lists the raw power registers and the corresponding virtual registers. pwr_cc establishes the amount of power represented by one pwr_lsb of the power registers. to avoid significant conversion loss, pwr_lsb should be chosen such that pwr_cc is > 1000. calculate the value of pwr_cc accord- ing to the following formula: pwr cc iv pwr lsb fs fs _ _ = 2 32 bit: 15 14 13 12 11 10 9 8 name: power units conversion coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: power units conversion coefficient low byte reset: 0x01 description raw virtual real power, phase a a.act pwrp.a real power, phase b b.act pwrp.b real power, phase c c.act pwrp.c real power, total pwrp.t reactive power, phase a a.rea pwrq.a reactive power, phase b b.rea pwrq.b reactive power, phase c c.rea pwrq.c reactive power, total pwrq.t apparent power, phase a a.app pwrs.a apparent power, phase b b.app pwrs.b apparent power, phase c c.app pwrs.c apparent power, total pwrs.t real power, phase a, fundamental frequency only a.actf pwrpf.a real power, phase b, fundamental frequency only b.actf pwrpf.b real power, phase c, fundamental frequency only c.actf pwrpf.c real power, total, fundamental frequency only pwrpf.t reactive power, phase a, fundamental frequency only a.reaf pwrqf.a reactive power, phase b, fundamental frequency only b.reaf pwrqf.b reactive power, phase c, fundamental frequency only c.reaf pwrqf.c reactive power, total, fundamental frequency only pwrqf.t apparent power, phase a, fundamental frequency only a.appf pwrsf.a apparent power, phase b, fundamental frequency only b.appf pwrsf.b apparent power, phase c, fundamental frequency only c.appf pwrsf.c apparent power, total, fundamental frequency only pwrsf.t downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 49 energy units conversion coefficient (enr_cc) (0x01a) this register contains the value by which the raw accumulated energy value in each phase is multiplied before beingpresented to the virtual energy registers. the table below lists the raw energy accumulators and the corresponding virtual registers. bit: 15 14 13 12 11 10 9 8 name: energy units conversion coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: energy units conversion coefficient low byte reset: 0x01 description raw virtual real energy, phase a, positive direction a.eapos real energy, phase a, reverse direction a.eaneg enrp.a* real energy, phase b, positive direction b.eapos real energy, phase b, reverse direction b.eaneg enrp.b* real energy, phase c, positive direction c.eapos real energy, phase c, reverse direction c.eaneg enrp.c* real energy, total enrp.t reactive energy, phase a, positive direction a.erpos reactive energy, phase a, reverse direction a.erneg enrq.a* reactive energy, phase b, positive direction b.erpos reactive energy, phase b, reverse direction b.erneg enrq.b* reactive energy, phase c, positive direction c.erpos reactive energy, phase c, reverse direction c.erneg enrq.c* reactive energy, total enrq.t apparent energy, phase a a.es enrs.a apparent energy, phase b b.es enrs.b apparent energy, phase c c.es enrs.c apparent energy, total enrs.t real energy, phase a, positive direction, fundamental only a.eafpos real energy, phase a, reverse direction, fundamental only a.eafneg enrpf.a* real energy, phase b, positive direction, fundamental only b.eafpos real energy, phase b, reverse direction, fundamental only b.eafneg enrpf.b* real energy, phase c, positive direction, fundamental only c.eafpos real energy, phase c, reverse direction, fundamental only c.eafneg enrpf.c* real energy, total, fundamental only enrpf.t reactive energy, phase a, positive direction, fundamental only a.erfpos reactive energy, phase a, reverse direction, fundamental only a.erfneg enrqf.a* reactive energy, phase b, positive direction, fundamental only b.erfpos reactive energy, phase b, reverse direction, fundamental only b.erfneg enrqf.b* * these registers represent the algebraic sum of the positive and reverse energy in the two raw registers noted. thus, the energy returned in these virtual registers represents the net energy. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 50 ______________________________________________________________________________________ energy units conversion coefficient (enr_cc) (0x01a) (continued) description raw virtual reactive energy, phase c, positive direction, fundamental only c.erfpos reactive energy, phase c, reverse direction, fundamental only c.erfneg enrqf.c* reactive energy, total, fundamental only enrqf.t apparent energy, phase a, fundamental only a.esf enrsf.a apparent energy, phase b, fundamental only b.esf enrsf.b apparent energy, phase c, fundamental only c.esf enrsf.c apparent energy, total, fundamental only enrsf.t to avoid significant conversion loss, enr_lsb should be chosen such that enr_cc is > 1000. calculate the valueof enr_cc according to the following formula: temperature conversion coefficient (temp_cc) (0x060) this register contains the temperature conversion coefficient that is applied to convert the temperature sensor bina-ry output into degrees celsius, per the following equation, where raw_temp is the raw temperature sensor output. t_c = raw_temp x temp_cc/2 16 - 273.15 note that temp_cc should be obtained by calibrating the temperature sensor at the desired operation condition.typical approximate value is temp_cc = 0x0426. to read temperature, use the special register command 0xc01. enr cc ivt enr lsb fs fs fr _ _ = 2 16 * these registers represent the algebraic sum of the positive and reverse energy in the two raw registers noted. thus, the energy accumulated in these virtual registers represents the net energy. bit: 15 14 13 12 11 10 9 8 name: temperature conversion coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: temperature conversion coefficient low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 51 virtual registers the virtual registers are calculated values derived from one or more real registers. they are calculated at the timethey are requested, and thus could involve additional time to return a value. most virtual registers are 8 bytes in length and are delivered least significant byte first. power real power, phase x = a/b/c/t (pwrp.x) (a: 0x801, b: 0x802, c: 0x804, t: 0x807) this signed register contains the real instantaneous power delivered into phase a/b/c or total. power is calculatedfrom the instantaneous energy measurement according to the following equation: the register is 8 bytes long, but the most significant 2 bytes are not used. see the pwr_cc register description for more details. note that the sign bit is bit 47 for all 8-byte signed virtual registers. reactive power, phase x = a/b/c/t (pwrq.x) (a: 0x811, b: 0x812, c: 0x814, t: 0x817) this signed register contains the reactive instantaneous power delivered into phase a/b/c or total. power is calculat-ed from the instantaneous energy measurement according to the following equation: the register is 8 bytes long, but the most signficant 2 bytes are not used. see the pwr_cc register description for more details. pwrq x x rea pwr cc ns . ._ = 2 16 pwrp x xact pwr cc ns . ._ = 2 16 byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 52 ______________________________________________________________________________________ apparent power, phase x = a/b/c/t (pwrs.x) (a: 0x821, b: 0x822, c: 0x824, t: 0x827) this register contains the apparent instantaneous power delivered into phase a/b/c or total. power is calculatedfrom the instantaneous energy measurement according to the following equation: the register is 8 bytes long, but the most significant 2 bytes are not used. see the pwr_cc register description for more details. voltage and current rms volts, phase x = a/b/c (v.x) (a: 0x831, b: 0x832, c: 0x834) this register contains the rms voltage on phase a/b/c. the units are defined by the volt_cc setting such that v.x= x.vrms x volt_cc. in this equation, volt_cc is the conversion coefficient. see the volt_cc register for more information. rms amps, phase x = a/b/c/n (i.x) (a: 0x841, b: 0x842, c: 0x844, n: 0x840) this register contains the rms current on phase a/b/c or the neutral channel. the units are defined by the amp_ccsetting such that i.x = x.irms x amp_cc. in this equation, amp_cc is the conversion coefficient. see the amp_cc register for more information. pwrs x x app pwr cc ns . ._ = 2 16 byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 53 power factor power factor (pf.t) (0x867) this signed register contains the power factor of the total power. the power factor is calculated as:it is expressed in units of 0.00001; thus, unity power factor is expressed as decimal 100,000 (0x00000000000186a0). this register is presented as a twos complement value, so that a load delivering real power to the line (that is, reverse power) is seen as having a power factor of -1 (0x0000fffffffe7960). energy real energy, phase a/b/c/t (enrp.x) (a: 0x8c1, b: 0x8c2, c: 0x8c4, t: 0x8c7) this signed register contains the real accumulated energy delivered into phase a/b/c or total. the register is calcu-lated according to the following formula: enrp.x = enr_cc x (x.eapos - x.eaneg) reactive energy, phase a/b/c/t (enrq.x) (a: 0x8d1, b: 0x8d2, c: 0x8d4, t: 0x8d7) this signed register contains the reactive accumulated energy delivered into phase a/b/c or total. the register iscalculated according to the following formula: enrq.x = enr_cc x (x.erpos - x.erneg) apparent energy, phase a/b/c/t (enrs.x) (a: 0x871, b: 0x872, c: 0x874, t: 0x877) this register contains the apparent accumulated energy delivered into phase a/b/c or total. the register is the prod-uct of the enr_cc and x.es registers. pf t a act b act c act a app b app c app . .. . .. . = ++ ++ byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 54 ______________________________________________________________________________________ theory of operation analog front-end operation whenever the MAXQ3183 is in one of the active operat-ing modes (run mode or lowpm mode), the analog front-end operates continuously, scanning up to eight scan slots depending on the selected front-end config- uration. for each analog scan slot that is enabled, one of the eight differential input pairs is measured. the scan_ix and scan_vx (x = a/b/c), scan_in, and scan_te registers contain the settings for each slot, which include whether the slot is enabled and the differential input pair to measure during that scan slot. the logical mapping of the slots is fixed in following order: ? slot 0phase a current (ia) ? slot 1phase a voltage (va) ? slot 2phase c current (ic) ? slot 3phase c voltage (vc) ? slot 4phase b current (ib) ? slot 5phase b voltage (vb) ? slot 6neutral current (in)disabled by default ? slot 7temperature measurementdisabled by default the required time for each analog scan slot measure-ment (t c ) is determined by the MAXQ3183 system clock frequency and the setting of the r_adcratehardware register, as shown below: t c = 1/f clk x (r_adcrate[8:0] + 1) using the default register settings (r_adcrate = 167h= 359d), the time for each analog slot measurement (t c ) is 45s when the MAXQ3183 is running at 8mhz. since there are eight analog scan slots in the measure-ment frame, the total time for all measurements (t fr ) is t c x 8. using the default settings with the MAXQ3183 running at 8mhz, the entire sequence of measurementstakes 360s to complete, which, in turn, means that 360s will elapse, for example, between one phase a current measurement and the next. even if some of the analog measurement slots (such as neutral current or temperature measurement) are skipped by setting the dadcnv bit in that slots regis- ter to 1, the time period for that slot will remain in the frame, ensuring that the total frame time is always t c x 8, regardless of which individual slots are enabled ordisabled. digital signal processing (dsp) terminology establishing the precise definitions of some of the termsused in this document will assist in understanding how the dsp functions. sample period: the amount of time required to mea- sure a single data element; 45s, by default.adc frame period: the amount of time required for the adc to sample all analog inputs; always equal to 8sample periods. the inverse of this value is the frame rate ; by default 2778 samples per second. this is the rate at which any particular signal is sampled by theMAXQ3183. line cycle: the period of time from one positive-going zero crossing on a voltage channel to the next positive-going zero crossing. at 50hz, this is nominally 20ms; at 60hz, this is nominally 16.67ms. cycle count: the number of line cycles contained in a single dsp cycle. an integer, this is typically set tosome value greater than one to minimize the effect of load variations that may not occur in every line cycle. by default, this value is 16. dsp cycle: the period of time over which line parame- ters are calculated. energy and other parameters areaccumulated once per dsp cycle. one dsp cycle is the time of a line cycle multiplied by the cycle count. ns: this value represents the number of adc frame periods in a dsp cycle. this is a noninteger calculatedvalue. for example, if the cycle count is set to unity, and the line frequency is exactly 50hz, the ns value would be 20ms/360s = 55.6. digital processing as voltage and current samples are collected, theMAXQ3183 performs a variety of digital filtering, accumulation, and processing calculations to arrive at meter-reading values (such as line frequency, rms voltage and current, and active and reactive power) that can then be read by the master. the MAXQ3183 calculates and detects values and conditions including the following: ? zero-crossing detection ? line frequency and line period calculation ? rms voltage (phase a, phase b, phase c) ? rms current (phase a, phase b, phase c, neutral current) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 55 ? power (active, reactive, and apparent) for each phase ? energy accumulation (including energy pulse output function) ? overvoltage detection ? overcurrent detection ? undervoltage detection per sample operations on every adc frame, the input samples are processedas follows: ? the voltage and current samples are read. the cur- rent sample is shifted to account for the gain appliedin the pga. the phase- and gain-corrected samples are passed to the next stage. ? both the current and voltage signals are passed through highpass filters (hpf) specified by thehpf_c variable. ? the current and voltage signals are now split into several components. the first of these components issquared and accumulated to begin the rms current and voltage process. the second is processed and accumulated to begin the real/reactive power calcu- lation. and a third is processed through a peak filter (specified by b0fund and a1fund registers) and then accumulated to provide information for the fun- damental frequency power calculations. the result is a set of accumulated values that representsquared voltage, squared current, and real (active) and reactive (p and q) energies for both the entire usable spectrum and as filtered by the peak filter. the real and imaginary components of energy at this point do not yetrepresent real and reactive power; to obtain usable power values further processing is required. each of these values is further processed at the end of each dsp cycle. per dsp cycle operations at the end of each dsp cycle, accumulated informationis available that is used to calculate all other opera- tional results in the meter. dsp cycles track the line fre- quency and have a duration of the number of cycles specified in the cycnt register. on each phase, the time required for cycnt cycles to complete is calculat- ed and this value is used to update the duration of one dsp cycle, specified in the ns register. ns contains the number of adc frame periods in a sin- gle dsp cycle. because line frequency varies slightly from cycle to cycle, and because the adc frame clock is not synchronized to the line, the value of ns is not an integer, and varies slightly from dsp cycle to dsp cycle. because the value of ns is so critical to accurate calcu- lation of energy, ensuring that it is correct on every cycle is essential. there are two ways to manage the slight variation of ns from cycle to cycle: first, one could simply replace the old value of ns with the newly calculated value on each dsp cycle. this means that ns (and every other value in the meter, since they depend on ns) would have a significant amount of uncertainty. a better method is to use each newly cal- culated value of ns as an input to a filter. the output of the filter is then the value of ns that is actually used incalculations. in the MAXQ3183, this filter is controlled by the avg_ns register. current input adc hpf bpf bpf e p i 2 e q x 2 v 2 x 2 energy processing e pf e qf energy processing voltage input hpf gain sel i_gain v_gain adc figure 9. per sample operations downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 56 ______________________________________________________________________________________ a second problem with updating ns on every linecycles is the fact that noise impulses that occur at near- ly the same time as the zero crossing can shift the zero crossing, affecting the accuracy of the energy mea- sured during the preceding period. for this reason, a second register, rej_ns contains a value that specifies how far a particular sample can deviate from the aver- age and still be considered valid. if the period of the newly acquired dsp cycle differs from the previously accumulated average value by more than rej_ns adc frames, ns is not updated with the new period (but the energy is still accumulated). with this discussion in mind, the signal path for the vari- ous reported parameters can be reviewed. rms volts and rms amps: first, the squared voltage accumulation is divided by ns. this accomplishes themean part of the root-mean-square calculation. then, the square root of the result is taken, producing the raw rms calculation value. on the voltage channel, the signal is ready for gain compensation to be applied. but on the current channel, there is an additional twist: depending on the amplitude of the current, there may be a gain factor pre-applied before the raw sample is available. to compensate for inaccuracy in the gain factor for the amplifier and for noise seen in the channel at high gain settings, it may be necessary to provide linearity compensation. there are three registers that manage the linearization of the current signal: the x.offs_hi (x = a/b/c) regis- ter contains a signed value that is added to the raw rms current signal before further processing; the x.offs_lo register contains a signed value that is added to the raw rms current signal when the currentsignal is below a low current threshold (1/32 of the full scale) value; and the x.gain_lo register contains a gain adjustment that is applied to the current signal when the current signal is below the threshold value. the practical effect of this is to turn what may be a somewhat nonlinear response curve for the current sen- sor to a much more linear response by two-piece approximation. the high current calibration term x.offs_hi is used so long as the instantaneous current exceeds the low- current threshold at some instant during a dsp cycle. as long as this threshold is crossed during a dsp cycle, the value in x.offs_hi controls the offset current. when the input stays below the low-current threshold for one dsp cycle, the x.offs_lo and x.gain_lo are applied. the low-current calibration terms (x.gain_lo and x.offs_lo) remain in effect until the peak of input current waveform exceeds 1/32 of full-scale current at any time during a dsp cycle. as a final step, both voltage and current are passed through an averaging filter that provides smoothing for the signals. the amount of filtering is given in avg_c. energy: the per-sample processing produces a pair of digital signals that represent the complex energy sig-nal. from this complex signal, it is desired to extract the real portion and the reactive portion. at first glance, this seems trivial: the real portion is the real part of the com- plex signal, and the reactive portion is the imaginary part of the complex signal. apparent power (in volt- amperes) is the magnitude of the complex signal, and power angle is the argument of the complex signal. linearization average avg_c i rms offs_hi gain_lo offs_lo raw_i average avg_c v rms raw_v i 2 ns v 2 ns figure 10. computation of rms values downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 57 but current sensors and other external circuitry compo-nents introduce a phase distortion to the current signal, and this phase distortion may not be constant at all cur- rent values. consequently, for the most precise mea- surements, the phase between the voltage and current signals must be compensated. in the MAXQ3183, the energy signals are compensated for phase offset by performing a complex multiplication of the signal with the contents of the appropriate phase offset register. determining which phase offset register is appropriate is a matter of comparing the incoming rms current for the phase with the contents of the i1thr and i2thr regis- ters. it is the responsibility of the administrative software to ensure that i1thr is greater than or equal to i2thr. if the raw rms current is greater than or equal to the con- tents of i1thr, then the angle expressed in pa0 is used to compensate the phase angle. if the raw rms current is less than i2thr, then the angle expressed in pa2 is used to compensate the phase angle. and if the raw rms current falls between i1thr and i2thr then pa1 is used to compensate the phase angle. in this way, a three-piece stepwise approximation of the phase response of the current sensor is available. to use a constant phase compensation, set i1thr and i2thr to zero and insert the phase compensation value into pa0. the same processing can be performed to calculate the reactive energy value. but reactive energy can be calculated in another way: calculate apparent energy by multiplying the raw rms volts and raw rms current, square this value, then subtract the squared realpower. the square root of this value is the reactive energy. similarly, apparent energy can be calculated in either of two ways: either as the product of the raw rms volts and amps, or as the square root of the sum of the squares of the real and reactive energy. which of these is selected depends on the value of the appsel bit in the opmode2 register: if 0, then apparent energy is the product of the raw rms volts and amps and reac- tive energy is calculated using the difference of squares method; if 1, apparent energy is calculated using the sum of squares method and reactive energy is calculated directly from the complex energy. line frequency and phasor angles: line frequency can be taken directly from the ns value. recall that nsis the number of frames in a dsp cycle. since each frame is 360s, simply multiply ns by 360s and divide by cycnt to obtain the line period. the reciprocal of this is the line frequency. to calculate phasor angles, the numbers of samples between zero crossings on phase a and b and on phase a and c are taken. since ns is the number of samples during a complete dsp cycle, it is easy to calculate the fraction of a complete cycle. the software then converts this value to degrees and adjusts it such that no negative angles are reported. no calibration is required for line frequency and phasor angle calculation. energy accumulation once real and reactive energy over the most recentdsp cycle has been calculated, it is necessary to accu- mulate the result. for reactive energy, the result accumulated during any dsp cycle may be positive (for an inductive load) or pa pa i i thr pa i thr i i thr pa rms rms = > 01 11 2 2 , ,) , ,i i thr rms < ? ? ? ? ? ? ? ? ? ? 2 phase compensation pa0pa1 pa2 e p e q real/reactive processing linearization average avg_c e real offs_hi gain_lo offs_lo linearization offs_hi gain_lo offs_lo e_gain e_raw real e_raw reactive figure 11. phase compensation for energy calculations downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 58 ______________________________________________________________________________________ average avg_c e apparent e_gain appsel x 2 + y 2 e_raw real e_raw reactive x 2 - y 2 x y raw_i raw_v average avg_c e reactive e_gain appsel figure 12. apparent and reactive energy calculations negative (for a capacitive load). these values are sepa-rately accumulated. this means that during any one dsp cycle, only positive or negative reactive energy will be accumulated. similarly, for real energy, the result accumulated during any dsp cycle can be positive (that is, energy is deliv- ered to the load) or negative (that is, energy is driven back into the line). as is performed for reactive energy, these values are separately accumulated. apparent energy is also accumulated, but since this value is always positive or zero, there is only one apparent energy accumulator. from time to time, the accumulators generate an over- flow. when this occurs, the appropriate bit is set in the overflow status register x.eover. when an overflow occurs, supervisory code running on the host processor must make the appropriate adjust- ments in the reported energy. in many cases, this could simply involve incrementing an overflow counter. the host processor must then clear the overflow indication. no-zero-crossing detection the MAXQ3183 monitors the voltage signal on eachphase for zero-crossing events. if no ascending zero crossings are detected within a dsp cycle, the nozxf (x.flags) flag is set by the MAXQ3183 to notify the master of this condition. if the nozxm bit is set, this flag sets the nozx bit in the irq_flag. if the interrupt enable bit enozx is set to 1, the interrupt signal irq is driven low by the MAXQ3183 whenever nozx = 1. themaster can clear nozxf and nozx back to 0 to remove the interrupt condition. phase sequence status phase sequence status bits phseqv and phseqi indi-cate the order in which zero crossings are detected. when a zero-crossing event occurs on the phase a sig- nal, followed by phase b, phase c, and then phase a again, this bit cleared. if a zero crossing on phase a is then followed by a zero crossing on phase c, then phase b, this bit set to 1. rms voltage, rms current, and energy calculation for each of the three phases, the MAXQ3183 calcu-lates rms voltage and rms current values, as well as determines active and reactive energy, using a line- cycle-based integration process. power calculation (active, reactive, apparent) the power, energy, and rms calculation process con-sists of two tasks: continuous accumulation and post- processing triggered every cycnt line cycles. the accumulation task accumulates raw data obtained from the afe during cycnt line cycles. this task is performed continuously in the background by the MAXQ3183. when a cycnt line cycles accumulation stage has completed, which is determined by a dedi- cated frame counter exceeding the ns level, the raw integral accumulator values are saved for postprocess- ing and cleared, beginning the next cycle of accumu- lation task. then, the dsp postprocessing is triggered to process saved integrals and calculate energy, power, etc., values. note that the background accumu- lation task continues while foreground postprocessing downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 59 is taking place, i.e., both tasks are executed simultane-ously sharing cpu time. it is essential that the dsp postprocessing calculations be completed before the next dsp trigger to avoid losing accumulated data. the master should allow enough processing time by adjusting the r_adcrate register. default settings provide plenty of cpu time for both tasks. the MAXQ3183 accumulates raw sums and calculates line-cycle integrals for each voltage-current pair sepa- rately. the individual power accumulators are: ? pa = v a x i a ? pb = i b x v b or -i b x v c or -i b x (v a + v c ) or -i b x (v a - v c ) ? pc = v c x i c the pa and pc accumulators always operate in a sin-gle mode: (v a x i a ) for the pa accumulator, (v c x i c ) for the pc accumulator. alternately, the operating mode ofthe pb accumulator is defined by setting the con- cfg[1:0] bits in the opmode1 register. energy accumulation start delay all filters have a certain settling time before accurateenergy readings can be accumulated. to avoid accu- mulation of invalid data from filters that are still settling, an energy accumulation timeout period can be set in the acc_timo register. when acc_timo > 0, comput- ed energy is not accumulated for acc_timo of dsp cycles. the MAXQ3183 will decrement the acc_timo register every dsp cycle until it becomes 0. when acc_timo reaches 0 value, energy accumulation begins (or resumes, if acc_timo was set to nonzero value by the master). pulse outputs are also disabled when acc_timo > 0. the default value of acc_timo is 0x05. no-load feature to avoid meter creep, no energy accumulation shouldtake place when measured current is less than a cer- tain threshold. the noload register can be pro- grammed to enable and configure this feature. if the measured x.irms value for a phase (a, b, or c) falls below the noload threshold, the energy accumulators for this phase are not incremented. setting noload = 0 disables this feature. full scale is represented by 0x10000. on demand calculations so far in this discussion, the values being calculatedand managed in the MAXQ3183 have been based on fundamental units meaningful to the device itself: volt- age as a binary fraction of full-scale voltage; current as a binary fraction of full-scale current, and time as a non- integer multiple of the adc frame time. but a practical electricity meter must report its results in standard units, such as volts, amperes, and watts. the MAXQ3183 contains a mechanism to convert the inter- nal units (meter units) to real world units (display units). this conversion is performed in the conversion constant (cc) registers. for some of these values (voltage, current) the calcula- tion is simple: multiply by the conversion constant. for other values (power, energy) the calculation is more complex. in any case, the value in the cc register affects only the conversion from a meter unit to a dis- play unit; calibration is handled separately in the gain adjustment registers for each recorded value. the results of all on-demand calculations are reported as 8-byte (64-bit) values of which no more than 6 bytes (48 bits) are significant. eight bytes are used as a com- mon length; however, fewer bytes can be requested for those registers known to have smaller maximum values. for example, the power factor virtual register has a maximum value that is expressed in only 3 bytes; con- sequently, the register can be requested with a length of 4 bytes without loss of data. rms volts, rms amps these registers (v.a, v.b, v.c, i.a, i.b, i.c) are calculat-ed by simply multiplying the calculated rms value (a.vrms, b.vrms, c.vrms, a.irms, b.irms, c.irms) by the contents of the volt_cc or amp_cc register. since the rms voltage and rms current are given in 32-bit registers and the conversion coefficients are given in 16-bit registers, the result of the product is 48 bits. regardless of the internal units used, volt_cc and amp_cc can be tailored so that the lsb of the virtual register can be any value. for example, if one wished to have a 32-bit value representing milliamps, one could multiply by a value that scaled the register such that the lsb was 2 -16 ma. then, discard the low-order 16 bits. the result is milliamps with 32 bits of precision;thus, the maximum current that could be represented would be 4,294,967,296ma, or just over 4ma. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 60 ______________________________________________________________________________________ the volt_cc and amp_cc values can be calculatedfrom the full-scale voltage or full-scale current and the desired value of one lsb in the display register: example: assume the full-scale current is 102.4a, and that we desire a 1na lsb. the calculation would pro-vide an amp_cc value of: 102.4/(2 24 x 10 -9 ) = 6104 = 0x17d8 power the MAXQ3183 measures energy. but power is justenergy per unit time, and the MAXQ3183 keeps track of the time unit over which energy is accumulated. this is simply the ns value, the fractional number of samples that comprises one dsp cycle. so converting energy to power is as simple as dividing the accumulated energy over one dsp cycle by ns. multiplying by a conversion constant (pwr_cc) gives power in user-established units. the power registers (pwrp.a, pwrp.b, pwrp.c, pwrq.a, pwrq.b, pwrq.c, pwrs.a, pwrs.b, pwrs.c) are calculated by multiplying the accumulat- ed energy (a.act, a.rea, a.app, b.act, b.rea, b.app, c.act, c.rea, c.app) by the conversion coeffi- cient (pwr_cc) and then dividing by ns. the result is the 48-bit average power over the most recent dsp cycle, in units established by the conversion coefficient. the pwr_cc value can be calculated from the full- scale voltage, the full-scale current, and the desired value of one lsb in the display register: example: for this example, assume the full-scale cur- rent is 102.4a, the full-scale voltage is 558.1v, and thatthe desired lsb is milliwatts after discarding the 16 lsb; that is, the desired lsb is 2 -16 milliwatts. perform the following calculation: 102.4 x 558.1/(2 32 x 2 -16 x 10 -3 ) = 872 = 0x0368 power factor power factor is calculated as real power divided byapparent power. but note that apparent power can be calculated in either of two ways: either as a square root of the sum of the squares of the real and reactive power, or more commonly as the product of the rms voltage and current measurement. the power factor asreported could change when one or the other of these methods is used. the power factor is multiplied by 2 14 before it is report- ed; thus, unity power factor is given by 16,384 decimal(0x4000). line frequency the line frequency is derived directly from the mean nsvalues over the three phases. it is reported as millihertz; thus, a 50hz line frequency is reported as decimal 50,000 (0xc350). phasor angles the phasor angles are taken directly from the angularmeasurement values determined at each dsp cycle. the angle is reported in units of 0.01 degree; thus, a 120 phasor is reported as decimal 12,000 (0x2ee0). energy energy is read as the net energy directly scaled fromthe appropriate registers. for example, the energy read from the enrp.a register (real energy, phase a) is composed of the difference between the a.eapos (real energy, positive direction, phase a) and a.eaneg (real energy, negative direction, phase a) registers scaled by the enr_cc register. note that the energy registers (enrp.a, enrp.b, enrp.c, enrp.t, enrq.a, enrq.b, enrq.c, enrq.t, enrs.a, enrs.b, enrs.c, enrs.t) represent the ener- gy, in every case, since the last overflow event. for this reason, software must keep track of overflow and make adjustments accordingly when using this register set. to calculate the enr_cc register value, begin with the full-scale voltage and full-scale current, the frame time, and the desired lsb value for energy. then perform the following calculation: example: it is essential to ensure that the correct units are maintained throughout the calculation. in this exam-ple, assume that the full-scale voltage is 558.1v, the full-scale current is 102.4a, the frame time is the default of 360s, and the desired lsb is 100 milliwatt-hours after the 32 bits are discarded; that is, the lsb is 0.1 x 2 -32 watt-hours. notice, however, that the frame time is given in microseconds and must be converted to hours before the calculation can be performed: 360s is 100x 10 -9 hours. so the calculation proceeds as follows: 102.4 x 558.1 x 100 x 10 -9 /(2 16 x 0.1 x 2 -32 ) = 3745 = 0x0ea1 enr cc ivt enr lsb fs fs fr _ _ = 2 16 pwr cc iv pwr lsb fs fs _ _ = 2 32 volt cc v volt lsb fs _ _ = 2 24 amp cc i amp lsb fs _ _ = 2 24 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 61 meter pulse the purpose of a meter pulse is generally to advance amechanical counter when such a device is used as a display. meter pulses are also used during calibration since time intervals can be measured with great preci- sion. the MAXQ3183 supports two meter pulse outputs. these outputs can be configured for either active posi- tive or active negative pulses by means of the popol bit in the opmode1 register. when triggered, the pulse goes to its active state and remains there for a period of time defined by the pls1_wd or pls2_wd register, and then returns to the inactive state (unless triggered again). the pls1_wd and pls2_wd registers contain the time in adc frame periods that the pulses remain in the active state when triggered. by default, these registers contain decimal 156 (0x9c) giving, at the default frame rate, a pulse width of approximately 50ms. each pulse generator can select one parameter to be accumulated over any combination of the three phases. for example, one could select real energy accumulated over all three phases for pulse output 1, and reactive energy accumulated over all three phases for pulse output 2. the particular parameters that can be accu- mulated are given in the register table. among the quantities that can be accumulated by the pulse subsystem are the arithmetic active energy (that is, the accumulated positive real energy minus the accumulated negative real energy) and the absolute active energy (that is, accumulated positive real ener- gy plus accumulated negative real energy). other quantities include rms voltage and current, positive and negative real energy and reactive energy in each of the four quadrants. select the desired accumulation value in the qnsel field of the plscfg1 and plscfg2 register. also in the pulse configuration registers you can select which phases to include in the accumulation. set any or all the phasea, phaseb, and phasec bits in the plscfg1 or plscfg2 registers to include them in the accumulation. generating pulses on every dsp cycle, the MAXQ3183 adds the value inthe selected register (or set of registers) to the pulse accumulator. if the value in the pulse accumulator exceeds the value in the associated threshold register (thr1 or thr2), then a pulse is started and the value in the threshold register is subtracted from the value in the pulse accumulator. meter constant a meter constant is the number of pulses that are gen-erated during a standard measurement interval; for example, a meter might specify a meter constant of 1600 pulses per kilowatt-hour. the thr1 and thr2 registers are used to specify the meter constant according to the following formula: in this formula, thr is the value to be written to the threshold register, k m is the desired meter constant (in pulses per kilowatt hour), i fs and v fs are the full-scale voltage and current, respectively, and t fr is the frame period in units of hours, as in the previous calculation.as an example, assume once again a full-scale voltage value of 558.1v = 0.5581kv, a full-scale current value of 102.4a, a desired meter constant of 1600 pulses per kilowatt hour, and a default frame time of 360s (88.9 x 10 -9 hours). the threshold register value can be calcu- lated as: 65,536/(1600 x 102.4 x 0.5581 x 100 x 10 -9 ) = 7,167,174 = 0x6d5cc6 increasing the value of the threshold register reduces the meter constant (that is, there are fewer pulses perkilowatt-hour); reducing the threshold register increases the meter constant (that is, there are more pulses perkilowatt-hour.) interrupts the MAXQ3183 contains an interrupt subsystem torelieve the host processor of the burden of constantly polling the device for status. instead, under certain cir- cumstances, the MAXQ3183 can activate an external pin to alert the host processor that some condition requiring host attention has occurred. interrupts are managed globally by the irq_mask and irq_flag registers. in general, when a bit becomes set in the irq_flag register, an interrupt is generated if the corresponding bit is set in the irq_mask register. interrupts can be configured for the following conditions: pwrf: this flag indicates the v dvdd to the MAXQ3183 has fallen below its nominal operatingthreshold (about 2.85v). this can be taken as an indication that power failure is imminent and that the host processor should begin taking steps to ensure an orderly shutdown. chsch: this flag indicates that the chksum regis- ter changed its value. thr ki v t mfs fs fr = 2 16 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 62 ______________________________________________________________________________________ eovf: energy overflow. this flag indicates that one or more energy accumulators (x.eapos, x.eaneg, etc.)have overflowed. in a traditional meter, the host processor would poll the MAXQ3183 to determine which of the energy accumulators have overflowed and adjust its internal accounting registers accordingly. isumovf: the vector sum of currents over the most recent dsp cycle has exceeded the vector sumthreshold. oc: the rms current value on one or more of the phases over the most recent dsp cycle has exceed-ed the value set in the oclvl register. ov: the rms voltage on one or more of the phases over the most recent dsp cycle has exceeded thevalue set in the ovlvl register. uv: the rms voltage on one or more of the phases over the most recent dsp cycle has failed to exceedthe value set in the uvlvl register. nozx: zero crossings were not detected on one or more of the phases during the dsp cycle.dcha: tells the host processor that the direction of net real energy flow on one of the three phases haschanged during the current dsp cycle as compared to the previous dsp cycle. dchr: tells the host processor that the direction of net reactive energy flow on one of the three phaseshas changed during the current dsp cycle as com- pared to the previous dsp cycle. dsprdy: indicates that the latest dsp cycle has just completed.dspor: indicates that the processing for the previ- ous dsp cycle had not been completed before thecurrent dsp cycle became available for processing. this overflow indication should never be seen in the default configuration; however, under some condi- tions (faster adc rate, slower cpu clock) the pro- cessing requirements may exceed the number of cpu cycles available for dsp processing. under these circumstances, the clock rate may be increased, the adc rate may be reduced (that is, the r_adcrate register may be increased), or the functional load (such as fundamental mode calcula- tions) may be cut. note that when dspor becomes set, all dsp calcu- lations as well as all pulse outputs are invalidated. the appropriate host response is to take the remedi- al action described above and discard the current set of dsp result values. each phase has a local register that contains copies ofthe oc, ov, uv, nozx, dcha, and dchr bits. thus, to determine which phase(s) have exception conditions requires four reads: the irq_flag register to deter- mine which conditions are active that are causing the interrupt to occur, and then a read to a.flags, b.flags, and c.flags to determine which of the phases have the indicated condition. finally, each phase has a pair of local registers that contain overflow flags for each energy accumulator. if the eovf bit is set in the irq_flag register, the host should then read the a.eover, b.eover, and c.eover registers to determine which of the phases have overflow conditions. if fundamental mode opera- tion is enabled, the host should read a.efover, b.efover, and c.efover as well. each of these reg- isters contains a bit for each of real and reactive energy in both positive and negative direction as well as apparent energy. overvoltage and overcurrent detection the MAXQ3183 detects overvoltage and overcurrentevents and can issue interrupt request signals to the master when these events occur. the overvoltage level can be programmed into the ovlvl register, while the overcurrent level is determined by the oclvl register. both ovlvl and oclvl registers represent the bits 23:8 of the vrms or irms registers. any time the MAXQ3183 detects the rms-value exceeding a thresh- old level, the ov or oc interrupt flag is set. if enabled, any of these flags issues an interrupt request. all inter- rupt flags are sticky bitsthe MAXQ3183 never clears them on its own unless a reset occurs. the inter- rupt flags should be cleared by the master by writing the appropriate register. meter units to real units conversion all energy calculations, including various thresholdchecks, are performed internally in fixed format in meter units. therefore, the threshold values must be supplied by the user in meter units as well. this section summa- rizes how to convert real units (v, a, kwh, w, and kah) into meter units and vice versa. the conversion factors are based on the settings of t fr , v fs , and i fs , defined by the users design. t fr is analog scan frame timing. this parameter is defined by the r_adcrate setting and system clockfrequency f sys : t fr = (r_adcrate + 1) x 8/f sys default conditions are r_adcrate = 359, f sys = 8mhz. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 63 v fs is full-scale voltage. this is the input voltage that produces full-scale adc output; defined by the hard-ware voltage transducer ratio v tr and adc full-scale input voltage v fsadc : v fs = v fsadc x v tr default conditions are v fsadc = 1.024v. v tr is design dependent.i fs is full-scale current. this is the input current that produces full-scale adc output; defined by the hard-ware current transducer ratio i tr and adc full-scale input voltage v fsadc : i fs = v fsadc x i tr default conditions are v fsadc = 1.024v. i tr is design dependent.meter units are defined with respect to the base para- meters as shown in table 5. when reading virtual registers, the MAXQ3183 uses the configurable conversion coefficients amp_cc, volt_cc, pwr_cc, and enr_cc to return meaningful data. table 6 describes how to set the coefficients. table 6. virtual register coefficients virtual register output resolution (1 lsb), defined by user coefficient power: pwrp.x, pwrq.x, pwrs.x, pwrpf.x, pwrqf.x, pwrsf.x pwr_lsb pwr_cc = mu_pwr/pwr_lsb voltage: v.x volt_lsb volt_cc = mu_volt/volt_lsb current: i.x amp_lsb amp_cc = mu_amp/amp_lsb energy: enrp.x, enrq.x, enrs.x, enrpf.x, enrqf.x, enrsf.x enr_lsb enr_cc = mu_enr/enr_lsb register or accumulator meter unit (1 lsb) current rms: x.irms pulse output current rms thr1 or thr2, when pulse output configured to irms mu_amp = i fs /2 24 voltage rms: x.vrms pulse output rms voltage thr1, or thr2 when pulse output configured to vrms mu_volt = v fs /2 24 energy: x.act, x.rea, x.app, x.eapos, x.eaneg, x.erpos, x.erneg, x.es fundamental energy: x.actf, x.reaf, x.appf, x.eafpos, x.eafneg, x.erfpos, x.erfneg, x.esf pulse output energy: thr1 or thr2 mu_enr = v fs x i fs x t fr /2 16 power: pwrp.x, pwrq.x, pwrs.x mu_pwr = v fs x i fs /2 32 when x.esf contains amp-hours: x.esf mu_ah = i fs x t fr /2 16 oclvl, noload, i1thr, i2thr i fs /2 16 ovlvl, uvlvl v fs /2 16 table 5. meter unit definitions downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 64 ______________________________________________________________________________________ units conversion examples the conversions from meter units to physical units areillustrated with the simplified input circuits in figures 13 and 14. the voltage input circuit is a voltage-divider. current input is through a current transfer with turn ratio of 2000:1. the voltage transducer ratio (v tr ) = (r1 + r2)/r2 = 545, v fs = 558.1v. the current transducer ratio (i tr ) = ct_n/(2 x r) = 2000/(2 x 10) =100 (a/v), i fs = 102.4a. the input circuits should be designed to avoid gettingtoo close to the adc input full scale at the specified maximum ratings. so for the above circuits, we would specify the maximum input current = 70a (rms) and maximum voltage = 390v (rms), to ensure that peak of sinusoudal waveform never exceeds i fs or v fs . use the default adc timing t fr = 360s, we get the fol- lowing meter unit to physical unit conversion coeffi-cients (these coefficients are not part of the MAXQ3183 registers): mu_amp = i fs /2 24 = 6.1e-6 (a) mu_volt = v fs /2 24 = 33.3e-6 (v) mu_pwr = v fs x i fs /2 32 = 13.3e-6 (w) mu_enr = v fs x i fs x t fr /2 16 = 87.2e-9 (wh) for example, if we get 0x07654af0 from reading0x1cc register (phase a current rms), the current value it represents is 0x07654af0 x mu_amp = 47.33 (a) for some low-end host microcontrollers, doing theabove math multiplication above could be difficult. for this reason, the MAXQ3183 provides conversions for some commonly needed parameters through the volt_cc, amp_cc, pwr_cc, and enr_cc registers. for example, if you want to display current in the reso- lution of 1ma, without having to use a multiplication operation to convert from the meter unit value0x07654af0, you would set amp_cc to 0x0190, and read from virtual register 0x831 (phase a rms current). the output would be 0xb8e45170. dropping the lower 2 bytes (right shifting 16 bits) gives 0xb8e4, or 47332 decimal (47332ma). amp_cc is computed as follows: amp_cc = (i fs /2 24 )/amp_lsb = mu_amp/amp_lsb amp_lsb = 0.001/2 16 (a) i fs = 102.4a amp_cc = (102.4/2 24 )/(0.001/2 16 ) = 400d = 0x0190 calibration procedure calibration overview calibration ensures that the recorded voltage, current,energy, and power are in accordance with the design criteria. before creating a calibration regimen, establish the fundamental units of the meter: the full-scale volt- age and current. then adjust the gain registers using calculated calibration constants to produce the expect- ed reading in the raw current, voltage, energy, and power factor registers. the calibration constants should be stored in non- volatile memory by the host microcontroller. upon any reset or loss of power, the host microcontroller must reload the MAXQ3183 with the constants. calibration always follows a set of fundamental steps: ? apply a known signal (voltage/current/power) to the meter. ? read the meter. ? calculate the correction factor based on the differ- ence between the applied signal level and the meterreading. ? write the correction factor to the appropriate register. MAXQ3183 i0p vcomm ia (ac) i0n r 10 r 10 figure 14. sample current input circuit MAXQ3183 vop va (ac) vn r2 1k r1 544k figure 13. sample voltage input circuit downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 65 ? read the meter quantity again to verify the calibra- tion. note that these steps can occur more than once for agiven signal type to verify readings at different signal levels. there are two methods to read the meter in the above second step. the first is to read the raw register associ- ated with the value under calibration, for example, a.vrms for the phase a voltage channel; a.irms for the phase a current channel, and a.act for phase a real power. the second calibration method assigns a pulse output to the value being calibrated and measures the pulse period. in practical use, the method chosen depends on the specific application and the available equip- ment. for example, in some applications the voltage and current are of no concern, but the energy accumu- lation must be very accurate. for these applications, meter calibration sets with built-in pulse measurement facilities can make the most sense. the calibration procedure involves the following gener- al steps: ? calibrate voltage for a given phase by applying a known voltage and adjusting the voltage gain(a.v_gain for phase a) until the rms voltage (a.vrms for phase a) reads the applied voltage in the designated units. ? calibrate current by applying a known current and adjusting the current gain (a.i_gain for phase a)until the rms current (a.irms for phase a) reads the applied current in the designated units. if desired, the current can be calibrated at two points (low range and high range) for more accuracy. ? once the current gain and voltage gain are calibrat- ed, the power/energy should not require any addi-tional adjustment for most situations. although, a separate power gain register is available for further fine-tuning of the power/energy accuracy. one must keep in mind that anytime voltage or current is recali- brated, the power or energy accuracy is naturally affected. so the power gain should be recalibrated to achieve the desired accumulative effect of voltage, current, and power gains. ? calibrate the phase offset by applying a power factor load and adjusting the phase angle offset according-ly. if desired, the phase offset can be calibrated at up to three points for more accuracy. once these elements are calibrated for each phase, allother information (power factor, reactive power, appar- ent power, etc.) is also properly calibrated. the descriptions in the following sections deal specificallywith phase a, but the same procedure is followed with phases b and c. calibrating voltage ensure that there is no previous value in the gain regis-ter, a.v_gain, by setting this register to 0x4000. ? apply a known voltage with rms value close to the desired maximum operating voltage (and less thanv fs / 2). ? read the a.vrms register. note the value. ? convert the known value to meter units by dividing it by mu_volt (= v fs /2 24 ). ? divide the applied value (in meter unit) by the value read from the MAXQ3183. the result should be avalue between 0 and 2. if the value falls outside of this range, you have probably miscalculated v fs . ? multiply the calculated value by 2 14 . the result is the gain value to be programmed into a.v_gain. ensurethe most significant bit is 0. when the gain value is programmed, wait for 2 to 3seconds, reread the rms value from a.vrms. check that the measured value is correct by comparing a.vrms against the applied voltage in meter unit. voltage calibration example assumptions: v fs is 558.1v. the applied voltage is 240 vrms. ? convert the applied voltage to meter units. this cal- culation gives 240 x 2 24 /558.1 = 7,214,714 = 0x006e1679. ? read the a.vrms register. you read 0x0708029. this is 7,372,841 decimal. ? divide the applied voltage by the voltage read from the meter. the result is 7,214,714/7,372,841 =0.97855. ? convert to integer by multiplying 2 14 : 16,384 x 0.97855 = 16,033 = 0x3ea1. write this value to thea.v_gain register. calibrating current ensure that there is no previous value in the gain regis-ter, a.i_gain, by setting this register to 0x4000. ? apply a known current with rms value close to the desired maximum operating current (and much lowerthan i fs / 2). ? read the a.irms register. note the value. ? convert the known value to meter units by dividing it by mu_amp (= i fs /2 24 ). downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 66 ______________________________________________________________________________________ ? divide the applied value (in meter unit) by the value read from the MAXQ3183. the result should be avalue between 0 and 2. if the value falls outside of this range, you have probably miscalculated i fs . ? multiply the calculated value by 2 14 . the result is the gain value to be programmed into a.i_gain. ensurethe most significant bit is 0. when the gain value is programmed, wait for approxi-mately 2 to 3 seconds, then reread the rms value from a.irms. check that the measured value is correct by comparing a.irms against the applied current in meter unit. current calibration example assume i fs is 102.4a and the meter has a base current of 10a and a maximum current of 60a. ? the meter is calibrated at the base current of 10a. ? convert the applied current to meter units. this cal- culation gives 10 x 2 24 /102.4 = 1,638,400 = 0x00190000. ? read the a.irms register. you read 0x0017dc85. this is 1,563,781 decimal. ? divide the applied current by the current read from the meter. the result is 1,638,400/1,563,781 = 1.0477. ? multiply by 2 14 x 1.0477 = 17,166 = 0x430e. write this value to the a.i_gain register. calibrating phase offset for this calibration step, it is necessary to have a powerfactor meter, capable of measuring phase angle, con- nected in the same circuit as the MAXQ3183 meter. note that calibration can be performed at any precision power factor setting. we use a pure resistive load (pf = 1.0) load to illustrate the procedure. ? apply a resistive load to the meter; the current drawn by the load should correspond to the base current ofyour meter. ? record the phase angle and direction (capacitive or inductive) reported on the power factor meter. ? read and record the real and reactive energy from the x.act and x.rea registers. divide the reactiveenergy by the real energy. this is the tangent of the power-phase angle. ? read the x.rea register. if the high-order bit is set, the power factor reported in the above step is capac-itive. if the high-order bit is clear, the power factor reported in the above step is inductive. ? now determine the correction factor: treating capaci- tive values as negative and inductive values as posi-tive, subtract the angle read from the MAXQ3183 from the angle read from the reference meter. theresult is the compensation angle. ? multiply the compensation angle (in radians) by 65,536. this is the value to write into x.pa0. if i1thr and i2thr are left at their default values(0x0000), then the value in x.pa0 is applied to the full measurement range. alternatively, you could write the same value into x.pa0, x.pa1, and x.pa2. then the same compensation is applied through the whole mea- surement range regardless of the i1thr and i2thr set- tings. if desired, calibrate for the phase angle at up to three different current levels to compensate for nonlin- earity in the current sensor. see the advanced operation section for more information. phase offset calibration exampleassume the meter is a 10/60 meter; that is, the base current is 10a and the maximum rated current is 60a. i fs is 102.4a and v fs is 558.1v. the test point is 10a and 240v. ? connect the MAXQ3183-based meter under test in series with a lab grade reference meter. see the con-figuration below. ? apply power to the meter and apply a load of 10a resistive. ? verify that the i1thr, i2thr, a.pa0, a.pa1, and a.pa2 registers contain zero. ? read the power factor on the reference meter. you read 1.5 capacitive. this is not unusual. the load might not be truly resistive or reactance in the test configuration could be reflected in the measurement. ? read the real energy from register a.act (0x1d0). you read 0x2865d6 (2,646,510 meter units). ? read the reactive energy from register a.rea (0x1d4). you read 0xffffa5c0 (-23,104 meterunits). ? divide the reactive by the active power: -23,104/ 2,646,510 = -0.009. v lab meter v unit under test load line neutral figure 15. offset testing setup downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 67 ? take the inverse tangent of this value. you get -0.5 ; that is, 0.5 capacitive. ? subtract the uut phase offset from the reference meter phase offset. in this case, the phase needs tomove 1 toward the capacitive. convert this value to radians: 1 x /180 = 0.0175 radians. ? multiply this value by 65,536. the result is 572 (0x023c). ? because the phase correction is toward the capaci- tive, the value must be complemented. the twoscomplement of 0x023c is 0xfdc4. this is the value that should be written to the pa0 phase compensa- tion register. at this point, the meter is compensated for a singlephase offset. if the phase offset were perfectly flat over all current levels, that would be sufficient (and for many current sensors, particularly current shunts, one point is usually good enough.) interfacing the MAXQ3183 to external hardware the MAXQ3183 has all the internal circuitry that isneeded for a sophisticated electricity meter, but specif- ic external hardware is required when configuring the meter for a particular application. the most critical decision that must be made is how the load will be con- nected to the power source, and how the meter will be connected to measure power consumed in the load. this section covers how to select hardware compo- nents for a MAXQ3183 electricity meter. connections to the power source generally, three-phase power as delivered from the util-ity consists of four wires: three voltage phases and a neutral wire. in one typical three-phase delivery system, measuring from neutral to any phase would read 120v, while measuring from any phase to any other phase would read 208v. connecting a load so that load cur- rent is taken from phase lines and returned to neutral is called a wye-connected load. connecting a load so that load current is provided by one phase and returned on another phase is called a delta-connected load. the MAXQ3183 can measure power consumed in either a wye-connected or a delta-connected load. if the load is connected in a wye fashion, the voltage is measured from the neutral lead to each of the phases, and the current measuring device is placed in series with the load, most often in the hot lead. the sensor is not placed in the neutral lead to prevent a customer from defrauding the utility by returning the current to ground rather than neutral. a current sensor placed in the hot lead makes fraud even more difficult. a delta-connected load can have current measured intwo possible ways. if it is primarily desirable to know how much power is delivered to the load, one can place the current sensor in the load circuit between two phas- es. but if it is more important to know how much current is being drawn from each supply phase, each current sensor is placed in the line circuit of each single phase. most utilities are only concerned with the total amount of energy being consumed. if individually accounting for the power delivered by each phase is not a require- ment, it is not necessary to measure all three voltages. instead, knowing only two voltages and the three cur- rents is all that is necessary to measure total energy usage. there are several ways of doing this. in a wye arrange- ment, one of the phasesusually phase bCcan be considered the voltage reference point instead of neu- tral. then the voltage measurements can be made from phase a to phase b and from phase c to phase b. by using some simple arithmetic, the power delivered by phase a, phase b, and phase c can be calculated even though only two voltages are available. a second mechanism is to have a delta-connected load, but with one legusually the bc legsplit into two equal loads. the point where the load is split is defined as the reference. in this arrangement, it is only necessary to know the voltage between phase c and the split and phase a and the split, since v c = -v a . finally, there is the connection arrangement in whichthe load is in a delta configuration with the current sen- sor at each load, but it is still desired to determine how much current is in each supply branch. the MAXQ3183 supports all of these connection arrangements. sensor selection the MAXQ3183 supports a variety of voltage and cur-rent sense elements. this section describes the proper- ties of many of these sensing devices. voltage sensors voltage-divider a voltage-divider is an ideal voltage-sensing elementwhen there is no need for voltage isolation. modern resistors have virtually no parasitic capacitance or inductance at the frequencies of interest in an electrici- ty meter and have extremely low variation with tempera- ture. when selecting resistors for a voltage-divider, keep the division ratio high enough so that the peak voltage value cannot exceed the maximum allowable input voltage. in the MAXQ3183, the peak input voltage is about 1v; consequently, a divider in the range of 400:1 to 600:1 is ideal. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 68 ______________________________________________________________________________________ the second consideration is the total power dissipationand voltage hold-off requirements of the resistor. it is tempting to design a 400:1 divider with a 400k resis- tor in series with a 1k resistor, but that would force the 400k resistor to dissipate about 140mw. this is not an excessive amount of power, but if the design is to usesmall smt parts, it can handle greater than a 1/10w smt resistor. it is better to use a series of several small- er components to improve system reliability. voltage transformer if isolation is required between the meter electronicsand the line, a voltage transformer is required. a volt- age transformer is designed to faithfully transfer an ac voltage applied on the primary side to a sensor on the secondary side. on the primary side, a voltage-divider is used to reduce the voltage to a workable level. on the secondary side, a load resistor is selected so that the current in the transformer windings is safely within the transformers linear operating region. because the impedance seen in the primary side of the transformer is equal to the impedance of the load resis- tor in the secondary circuit plus impedance of the transformer secondary winding at the operating fre- quency, it is easy to calculate the value of the required voltage-divider resistors in the primary side. for exam- ple, assume we want a 500:1 divider ratio and assume the load resistor is 600 and that the impedance of the transformer secondary is 200 . the resistor required in the primary is (600 + 200) x 500 = 400k often, this resistor is constructed from multipleinstances of a smaller value resistor; in this case, one might use eight 50k resistors. doing so minimizes the voltage requirements for the resistor chain and reducesthe possibility that a single point of failure will cause a catastrophic failure. current sensors current shunt a current shunt is a low-value (approximately 100 to a 100m ) resistor that converts a large-value current into a small voltage. shunts make good current sensorsbecause the output is an extremely linear representa- tion of the measured current, current shunts can have very low temperature coefficients, and they are inex- pensive. the power dissipated by a current shunt is inversely proportional to its resistance and proportional to the square of the output voltage. consequently, there is great incentive to reduce the resistance (and hence, the output voltage) of a shunt. often, full-scale current in a shunt produces only a few millivolts of output, mak-ing a front-end amplifier essential. the MAXQ3183 includes a gain-of-32 amplifier in the current channels that is automatically cycled in and out, depending on the input voltage of the current channels. current shunts operate at line voltage, thus, the afe must be isolated from the line. that means that in a wye-connected meter, the current sensing must be per- formed in the neutral return circuit (so that all voltages into the current-sense amplifiers are referenced to neu- tral). it also means that the use of a shunt is precluded for delta-connected meters; the MAXQ3183 cannot tol- erate the line-voltage differential between channels. current transformer in a current transformer, the primary is usually one turnof thick wire or buss bar and the secondary is often 1000 turns or more of magnet wire. a ferrite core mag- netically couples the two. thus, a large current in the primary turn creates a small current but large voltage in the secondary winding. for example, assume a current transformer with a 1000 turn secondary. a 10a current in the primary winding induces a 10ma current in the secondary. this current is made to flow through a so-called burden resistor, usually 10 to 20 . assuming a 20 burden, our 10a current thus produces a 200mv signal in the secondary. advanced operation modifying the adc operation there are several other registers that directly affect theafe function. these registers directly affect the hard- ware functionality, and should be modified only when it is explicitly required. for example, if the MAXQ3183 is operated at some frequency other than the nominal 8mhz system clock, modification of these registers by supervisory code becomes necessary to maintain a 360s frame time. ? r_acfg: this register contains bits that disable the adc entirely, disable the voltage reference bufferamplifier, and disable the adc interrupt. modifying this register will likely disable or impair operation of the MAXQ3183 internal firmware. ? r_adcrate: modify this register to change the rate at which the MAXQ3183 acquires samples. bydefault, r_adcrate contains 359 decimal, which means that the adc acquires a sample every 360 system clocks. with an 8mhz clock, this translates to 45s. if the system clock is slower, it may be advan- tageous to reduce this value to keep a 45s per sam- ple time constant. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 69 ? r_adcacq: modify this register to change the acquisition time. the acquisition time is the time fromadc power-on until conversion starts, and is provid- ed to allow the input amplifiers to settle. by default this is set to 47 decimal, or 6s at an 8mhz system clock. if the system clock rate is changed, then r_adcacq should change so that this value remains about 6s. fine-tuning the dsp controls fine-tuning the line frequency measurement line frequency measurement is based on zero-crossingdetection. for that purpose each voltage signal is passed through a digital lowpass filter, controlled by the zc_lpf register. this register specifies the b 0 coef- ficient of a first-order lpf using following formula:the msb of this register must be zero. for each phase a, b, and c, the MAXQ3183 counts the number of scan frames (ns) between zero crossings within a dsp cycle. each individual phase a, b, or c zero-crossing event contributes the raw ns count that plugs as input to lowpass filter: y n = y n - 1 + (avg_ns/65,536) x (x n - y n - 1 ) the filter coefficient is a signed 16-bit value and can beconfigured by master. here y denotes the global ns value, x denotes individual ns measurements pro- duced by zero-crossing events detected on the phase a, b, or c voltage channel. note that if all three phase voltages present, the filter above receives three inputs each dsp cycle. the global ns value is used to gener- ate the trigger for dsp processing. note that the ns value can be configured by the master, which could be necessary if all three voltage signals are lost and no zero-crossings are detected. the line period is then calculated as a product of ns and the scan frame t fr . the reciprocal of this value is the line frequency, whichcan be obtained as a fixed-point value with 1 lsb = 0.001hz by reading the linefr register. fundamental mode registers the MAXQ3183 keeps another set of real and virtualregisters to track power and energy at the fundamental line frequency. these fundamental mode registers behave identically to the standard power and energy registers, but are prefiltered to exclude harmonic power. the fundamental mode filter is specified in the b0fundand a1fund registers. b0fund is the feed-forward coefficient and specifies the bandwidth of the funda- mental mode filter; a1fund is the feedback coefficient and specifies the center frequency of the fundamental mode filter. in most cases, you can leave these filters at their default values. if you wish to change the filter parame- ters, first choose the desired bandwidth: b 0 = x bw x t fr in this equation, bw is the desired bandwidth in hertzand t fr is the frame period, typically 360s. set b0fund to b 0 x 2 16 . by default, b0fund contains dec- imal 145 (0x91) giving a bandwidth of about 2hz.to set the center frequency, calculate a 1 according to the following formula: a 1 = 2 - 2(1 - b 0 ) x cos(2 x f pk x t fr ) in this equation, b 0 is the previously calculated feed- forward coefficient, f pk is the desired center frequency in hertz, and t fr is the adc frame period. set a1fund to a 1 x 2 16 . by default, a1fund contains decimal 950 (0x3b6) giving a center frequency of approximately50hz. the fundamental mode filter is, by default, quite sharp with 3db points only 1hz off of the center frequency. this means that if the frequency drifts even only slight- ly, the fundamental mode power measurement is likely to have significant inaccuracy. the MAXQ3183 provides a mechanism to track the fre- quency by updating the a1fund register on each dsp cycle. this mechanism is automatically enabled by default. you may wish to disable the automatic tracking facility under some circumstances, particularly if you have defined a broader bandwidth than default and are com- fortable that the frequency will not drift beyond the passband. to disable the filter, set the dfuna bit in the opmode2 register. you may also elect to disable fundamental mode oper- ation completely. to do this, set the dfun bit in the opmode2 register. harmonic measurement in addition to the ability to measure power and energyat the fundamental frequency, the MAXQ3183 provides a mechanism to isolate a particular harmonic on any voltage or current channel and measure the amplitude of that harmonic. b zc lpf 0 16 2 = _ downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 70 ______________________________________________________________________________________ to enable harmonic measurement, first select a voltageor current channel to monitor. this is done in the aux_cfg register. the aux_mux field is the 4-bit value that selects one of the three voltage channels or one of the four current channels to monitor. the order of the harmonic is set in ordh field of the aux_cfg register. also in the aux_cfg register are two bits that enable the auxiliary channel and enable harmonic measure- ment on the auxiliary channel. to enable the auxiliary channel, set the enaux bit. once set, the MAXQ3183 will perform an rms calculation on the selected chan- nel. this is useful only for the i n (neutral current) chan- nel, since every other voltage and current already haverms calculations applied by default. (the dadcnv bit should be cleared in the scan_in register in order to enable sampling the i n channel.) to enable harmonic measurement, set the enharmbit. now, the selected voltage or current signal is passed to a filter that is identical to the second-order fundamental filter, but that has separate parameters (a1harm, b0harm). current total harmonic distortion plus noise (thdn) the MAXQ3183 can output the thdn ratio for selectedcurrent channel on-demand. it is calculated as: this represents the ratio of the power of harmonics plus noise over the power of the fundamental signal. to acti- vate thdn computation, the host must first configure the aux channel to produce first harmonic (fundamen- tal) on the desired current channel: ? set aux_cfg = 0x01c3 for current phase a ? set aux_cfg = 0x01c5 for current phase b ? set aux_cfg = 0x01c7 for current phase c then the thdn ratio can be read from one of the fol- lowing virtual registers: ? register 0x859 returns thdn.a for current phase a ? register 0x85a returns thdn.b for current phase b ? register 0x85c returns thdn.c for current phase c each register returns a raw binary value representing the thdn ratio with lsb = 2 C32 . since computation involves signal filtering, the value thdn could require afew seconds to settle before producing stable output. current vector sum the MAXQ3183 supports two forms of current vectorsum calculations depending on whether neutral current i n is available: i vs3 (t) = i a (t) + i b (t) + i c (t) or i vs4 (t) = i a (t) + i b (t) + i c (t) + i n (t) the sum must be calculated on instantaneous samplebasis. in a balanced 3-phase system, the vector sum i vs3 should be zero; a nonzero value indicates a currentunbalance. when neutral current available, vector sum i vs4 should be always zero, no matter balanced or unbal- anced loads; a nonzero value indicates tamper (energytheft) or wrong meter connection. in the MAXQ3183, the samples for i a , i b , i c , and i n are not simultaneous, there- fore the device automatically applies an allpass filter to i b , i c , and i n before calculating vector sum. the MAXQ3183 calculates the rms value of i vs3 or i vs4 on-demand using the aux channel. to activate vector sum computations, the host must set followingconfiguration bits: for i vs3 : 1) aux_cfg.enaux = 1to enable the aux channel 2) aux_cfg.aux_mux = 1001b (0x9)select ia + ib + ic input to the aux channel the above settings result in aux_cfg = 0x0049.for i vs4 : 1) scan_in.dadcnv = 0to enable adc sampling neutral current in (scan_in = 0x60) 2) aux_cfg.enaux = 1to enable the aux channel 3) aux_cfg.aux_mux =1111b (0xf)select ia + ib + ic + in input to the aux channel the above settings result in aux_cfg = 0x004f.once the above configuration is set, the MAXQ3183 starts accumulating the specified vector sum. the result can then be read from the n.rms register as raw value or from i.n virtual register as converted value. if the averaging filter is enabled (avg_c > 0), the value could require a few seconds to settle before producing stable output. the MAXQ3183 has an additional control bit aux_cfg.inrev to reverse the sign of in current. when the bit is set (aux_cfg = 0x006f), the MAXQ3183 cal- culates the value (ia + ib + ic - in) instead of (ia + ib + ic + in). doing so allows vector sum computation in case of reverse connection of neutral current sensor. a threshold (isumlvl, address 0x054) can also be specified to cause the MAXQ3183 to generate an inter- rupt when the vector sum exceeds the threshold. thdn x xirms xirms fund . . . = 2 2 1 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 71 low-power measurement mode (lowpm) this mode enables a subset of metering functions whileoperating from the lower frequency internal rc oscilla- tor to conserve power. the actual system clock fre- quency used is the rc oscillator output frequency divided by 8, which results in a system clock frequency of approximately 1mhz. the parameters provided in the lowpm are: ? voltage rms ? current rms ? ampere-hour the ampere-hour value is readable from the x.esf reg- isters (x = a/b/c). entry to lowpm mode only occurs at the request of the master. the master must set the lowpm_e bit (register address 0xc03) to 1 to place the MAXQ3183 into lowpm mode. entering lowpm mode changes the clock frequency, thereby invalidat- ing a number of configuration registers. as a result, the master must immediately reload the configuration regis- ters and filter with new, updated values before metering measurement operations can continue. the master instructs the MAXQ3183 to exit lowpm mode by reading the lowpm_x bit (register address 0xc04). temperature the MAXQ3183 contains a temperature sensor that canbe used by host software for any purpose, including compensating power readings for temperature effects. use the virtual register command (temp_c, address 0xc01) to perform a temperature conversion. the MAXQ3183 returns the value in degrees celsius, with a resolution of 1c. internally, the MAXQ3183 performs a temperature sensor read and scales the sensor output by the temp_cc (address 0x060) coefficient to provide an output in degrees celsius. the conversion formula is: temp_c = raw_temp x temp_cc/2 16 - 273.15 where raw_temp is raw digitized temperature sensoroutput that is proportional to absolute temperature. conversion coefficient temp_cc must be calibrated and set by the host; the default value is 0x0000. advanced calibrations calibrating current offset ideal hardware should produce a current reading lin-early proportional to the input current. however, due to noise or other factors, the rms current read by the meter might not be precisely linear. the current offset (x.offs_hi, x = a/b/c) can be used to compensatethe current channel nonlinearity. since the MAXQ3183 tracks the input current to deter- mine what linearity compensation factors to use, the user must choose two points (i lo and i hi ) comfortably above the low current threshold, and get the x.irmscurrent readings (r lo and r hi ). then calculate the y-inter- cept of the line drawn between the two points, that is,the offset. to calculate the value for the offset register, use the following formula: in this equation, i hi and r hi are the applied current and the current reading, respectively, in meter units at thehigher of the two reference currents; i lo and r lo are the applied current and the current reading, respectively, inmeter units at the lower of the two reference currents. the gain (x.i_gain) may require recalibration after the offset register updated. calibrating linearity the current channel includes a variable-gain amplifierthat introduces a gain of 32 when the current falls below the low current threshold (about 1/32 of full-scale current i fs ). because the gain of the amplifier cannot be controlled with arbitrary precision, and becausehigh gain implies increased noise, it may be necessary to calibrate the MAXQ3183 to maintain linearity at the lowest inputs. there are two settings that manage low-current lineari- ty: an offset setting, offs_lo; and a gain setting, gain_lo. setting the offset is simple. ensure no cur- rent is flowing in the current circuit. read x.irms. to calculate offset use following formula: offs = -x.irms program the offs into the offs_lo register.so, if the user reads 0x0113 from the x.irms register, program 0xfeed into the x.offs_lo register. setting the x.gain_lo register means applying a current below the low-current threshold, reading the value from the MAXQ3183, and adjusting the gain accordingly. note that the low-end gain is applied in addition to the overall gain provided in the x.i_gain register. apply a known current with peak value less than the low-current threshold. ensure that there is no previous value in the low-current gain register, a.gain_lo, by offs ri ir ii hi lo hi lo lo hi = () 2 4 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 72 ______________________________________________________________________________________ 0 1 2 i2thr i1thr pa2 i 2 i 1 i 0 pa1 pa0 input current phase offset figure 16. phase offset vs. input current calibration setting this register to 0x4000. read the a.irms regis-ter (0x1cc). note the value. convert the known value to meter units by multiplying the known value (in amperes) by 2 24 and dividing by i fs . divide the results of this cal- culation by the value read from the MAXQ3183. theresult should be a value between 0 and 2. convert the integer by multiplying 2 14 , and ensure msb is zero. the result is the gain value to be programmed intoa.gain_lo. calibrating power/energy gain once voltage and current have been calibrated, theenergy and power calculation automatically reflects the calibrated voltage and current. however the energy gain factor (x.e_gain, x = a/b/c) can be further tuned to achieve even more accurate power and energy result if necessary. for example, if the voltage and cur- rent calibration sources are not as accurate as the power/energy calibration source, then the additional gain calibration may be necessary. the following pro- cedure for power/energy gain calibration is outlined for phase a. ? apply a precision unity power factor power (applied value) that is close to the desired normal operatingpoint. ? read the pwrp.a register. note the value. ? convert the applied value to meter units by dividing it by mu_pwr. ? divide the applied value (in meter unit) by the value read from the MAXQ3183. the result should be avalue between 0 and 2. if the value falls outside of this range, i fs and/or v fs have probably been mis- calculated. ? multiply the calculated value by 2 14 , and ensure the msb is zero. the result is the gain value to be pro-grammed into a.e_gain. ? when the gain value is programmed, wait for 1 to 2 seconds, then reread the power value from pwrp.a.check that the measured value is correct by compar- ing pwrp.a against the applied power in meter unit. multipoint phase offset calibration to perform the calibration at three current levels, notethe raw current value (x.irms) at each point. label the current values, from highest to lowest, i 0 , i 1 , and i 2 . program x.pa0, x.pa1, and x.pa2 with the phase offsetvalues calculated at i 0 , i 1 , and i 2 , respectively, as described in the calibrating phase offset section. finally, program i1thr with the average of i 0 and i 1 , and program i2thr with the geometric average of i 1 and i 2 . now as the current changes the phase offset is adjusted accordingly. see figure 16. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 73 advanced register configurations analog scan configuration registers time slot assignmentcurrent channel x = a/b/c (scan_ix) (a: 0x008, b: 0x00c, c: 0x00a) these registers configure the time slot normally assigned to current channels a/b/c. we recommend leaving theseregisters at their default values. if they must be reassigned, one must ensure that all the current and voltage chan- nels are reassigned properly so that the MAXQ3183 computes the power/energy parameters as intended by your setup. bit: 7 6 5 4 3 2 1 0 name: adcmx dadcnv reset a: 0x3 0 0 0 0 reset b: 0x4 0 0 0 0 reset c: 0x5 0 0 0 0 bit name function 7:4 adcmx analog conversion select. this four-bit field determines which of the followin g analog inputs are sampled during this time slot. 0000 = v0p - vn 0001 = v1p - vn 0010 = v2p - vn 0011 = i0p - i0n (phase a current: 0011) 0100 = i1p - i1n (phase b current: 0100) 0101 = i2p - i2n (phase c current: 0101) 0110 = inp - vn 1xxx = temperature all other values are reserved. 3 dadcnv adc disable. when set, disables the adc for this time slot. 2:0 reserved. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 74 ______________________________________________________________________________________ time slot assignmentvoltage channel x = a/b/c (scan_vx) (a: 0x009, b: 0x00d, c: 0x00b) these registers configure the time slot normally assigned to voltage channels a/b/c. the user may wish to change thepgg settings to match the voltage sensor. however, it is recommended that the user not modify the adcmx settings. bit name function 7:4 adcmx analog conversion select. this four-bit field determines which of the following analog inputs are sampled during this time slot. 0000 = v0p - vn (phase a voltage: 0000) 0001 = v1p - vn (phase b voltage: 0001) 0010 = v2p - vn (phase c voltage: 0010) 0011 = i0p - i0n 0100 = i1p - i1n 0101 = i2p - i2n 0110 = inp - vn 1xxx = temperature 3 dadcnv adc disable. when set, disables the adc for this time slot. 2:0 pgg programmable gain amplifier select. this three-bit field configures the pr ogrammable-gain amplifier at the front-end of the analog input. the field has the following values: 000 = gain of 1 001 = gain of 2 010 = gain of 4 011 = gain of 8 100 = gain of 16 101 = gain of 32 all other values are reserved and can cause unpredictable behavior if se lected. bit: 7 6 5 4 3 2 1 0 name: adcmx dadcnv pgg reset a: 0x0 0 0x0 reset b: 0x1 0 0x0 reset c: 0x2 0 0x0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 75 time slot assignmentneutral current channel (scan_in) (0x00e) this register configures the time slot normally assigned to the neutral current channel. the user can change thedadcnv bit to enable/disable neutral current sampling. it is recommended to leave the other bits of this register at their default values. bit: 7 6 5 4 3 2 1 0 name: adcmx dadcnv reset: 0x6 1 0 0 0 bit name function 7:4 adcmx analog conversion select. this four-bit field determines which of the following analog inputs are sampled during this time slot. all other values are reserved. by default, this register is se t to 0110. 0000 = v0p - vn 0001 = v1p - vn 0010 = v2p - vn 0011 = i0p - i0n 0100 = i1p - i1n 0101 = i2p - i2n 0110 = inp - vn 1xxx = temperature 3 dadcnv adc disable. when set, disables the adc for this time slot. 2:0 reserved. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 76 ______________________________________________________________________________________ time slot assignmenttemperature channel (scan_te) (0x00f) this register configures the time slot normally assigned to the temperature measurement device. this register ismanaged by the firmware and should not be modified by the host. bit name function 7:4 adcmx analog conversion select. this four-bit field determines which of the following analog inputs are sampled during this time slot. 0000 = v0p - vn 0001 = v1p - vn 0010 = v2p - vn 0011 = i0p - i0n 0100 = i1p - i1n 0101 = i2p - i2n 0110 = inp - vn 0111 = auto-zero adc 1xxx = temperature by default, this register is set to 1000. 3 dadcnv adc disable. when set, disables the adc for this time slot. 2:0 pgg programmable gain amplifier select. this three-bit field configures the pr ogrammable-gain amplifier at the front end of the analog input. the field has the following values: 000 = gain of 1 001 = gain of 2 010 = gain of 4 011 = gain of 8 100 = gain of 16 101 = gain of 32 all other values are reserved and can cause unpredictable behavior if selected . this register is managed by the firmware and should not be modified by the host. bit: 7 6 5 4 3 2 1 0 name: adcmx dadcnv pgg reset: 0x8 1 0x2 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 77 neutral current and harmonics auxiliary channel configuration (aux_cfg) (0x010) the MAXQ3183 can monitor the rms value of one auxiliary channel in addition to its normal processing. theauxiliary channel configuration register selects which input the auxiliary channel processes and what processing is applied to the auxiliary channel. bit: 15 14 13 12 11 10 9 8 name: ordh reset: 0 0 0 0 0 0 0 0 bit: 7 6 5 4 3 2 1 0 name: enharm enaux inrev aux_mux reset: 0 0 0 0 0 0 0 0 bit name function 15:13, 4 reserved. 12:8 ordh order of harmonic (1C21). the output of harmonic voltage is read via virtual register 0x830 and current at 0x840. 7 enharm enable auxiliary channel harmonic filter. w hen set, the aux iliary channel is processed through the harmonic filter. the parameters for this filter can be set in the b0 harm and a1harm registers. 6 enaux enable auxiliary channel. when set, enables auxiliary c ha nnel processing. 5 inrev sets the sign of the neutral current, used in the vector sum calculation. 0 = positive, i.e., i n is directly summed with i a + i b + i c . 1 = negative, -i n is summed with i a + i b + i c . 3:0 aux_mux auxiliary cha nnel input or current vector sum select. the lower three bits s elect the input to be processed by the auxiliary cha nnel if the msb (bit 3) is cleared. w hen msb is set, this field selects vector sum computation: 1001 = i a + i b +i c 1111 = i a + i b + i c + i n (inrev = 0) or i a + i b + i c - i n (inrev = -1) 0001 = i n 0010 = v a 0011 = i a 0100 = v b 0101 = i b 0110 = v c 0111 = i c all other values are reserved. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 78 ______________________________________________________________________________________ dsp system configuration system clock frequency (sys_khz) (0x012) this register contains the system clock frequency in khz units. because the default frequency is 8mhz, this registerdefaults to 0x1f40. cycle count (cycnt) (0x01c) this register contains the number of line cycles that will be accumulated in a single dsp cycle. when cycnt linecycles have been accumulated, the dsp performs power, power factor, and energy calculations. by default, the cycle count is 0x10 (16 decimal). bit: 15 14 13 12 11 10 9 8 name: cycle count high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: cycle count low byte reset: 0x10 bit: 15 14 13 12 11 10 9 8 name: system clock frequency high byte reset: 0x1f bit: 7 6 5 4 3 2 1 0 name: system clock frequency low byte reset: 0x40 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 79 number of scan frames per dsp cycle (ns) (0x040) the ns register defines the fundamental timing for the electricity meter. it defines a dsp cycle in terms the period ofthe adc scan frame. generally, this register is calculated and updated automatically by the MAXQ3183 firmware based on the zero-crossing detection, and whether noise rejection (rej_ns) and averaging (avg_ns) are enabled. host code can write to this register in order to set the desired dsp cycle duration. the duration of one scan frame (t fr ) is represented as 0x00010000. filter coefficients line cycle noise rejection filter (rej_ns) (0x02c) this register establishes the sensitivity of the ns rejection filter setting. ns is a measure of the line frequency. if a linecycle occurs that is shorter or longer than the line cycle represented in the ns register, this filter determines whether the cycle is used to update the ns value. for more information, see the ns register description. if this register is zero, noise rejection is disabled for the line cycle counter. bit: 15 14 13 12 11 10 9 8 name: line cycle noise rejection filter high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: line cycle noise rejection filter low byte reset: 0xc8 bit: 31 30 29 28 27 26 25 24 name: integer portion, high byte reset: 0x03 bit: 23 22 21 20 19 18 17 16 name: integer portion, low byte reset: 0x28 bit: 15 14 13 12 11 10 9 8 name: fractional portion, high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: fractional portion, low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 80 ______________________________________________________________________________________ line cycle averaging filter (avg_ns) (0x02e) this register determines whether the ns value is averaged over previous values or whether the most recently measuredvalue is used directly. if the value of this register is nonzero, the ns value is averaged using the following formula: if the value of this register is zero, ns is not averaged. the msb of this register must be zero. meter measurement averaging filter (avg_c) (0x030) this register determines whether the all other measured values in the electricity meter are averaged over time. if thevalue of this register is nonzero, all measured meter values are averaged using the following formula: if the value of this register is zero, no averaging is performed. the msb of this register must be zero. yy a v gc xy nn nn =+ 1 1 16 2 _ yy a v gn s xy nn nn =+ 1 1 16 2 _ bit: 15 14 13 12 11 10 9 8 name: meter measurement averaging filter high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: meter measurement averaging filter low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: line cycle averaging filter high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: line cycle averaging filter low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 81 meter measurement highpass filter (hpf_c) (0x032) this register specifies the b 0 coefficient of a first-order butterworth filter using the following formula: the msb of this register must be zero. fundamental filter feed-forward coefficient (b0fund) (0x034) this register specifies the b 0 (feed-forward) coefficient for the fundamental-mode filter using the following formula: the msb of this register must be zero. b b fund 0 16 0 2 = b hpf c 0 16 2 = _ bit: 15 14 13 12 11 10 9 8 name: fundamental filter feed-forward coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: fundamental filter feed-forward coefficient low byte reset: 0x91 bit: 15 14 13 12 11 10 9 8 name: meter measurement highpass filter high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: meter measurement highpass filter low byte reset: 0xc8 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 82 ______________________________________________________________________________________ fundamental filter feedback coefficient (a1fund) (0x036) this register specifies the a 1 (feedback) coefficient for the fundamental-mode filter using the following formula: harmonic filter feed-forward coefficient (b0harm) (0x03a) this register specifies the b 0 (feed-forward) coefficient for the harmonic-mode filter using the following formula: the msb of this register must be zero. b b harm 0 16 0 2 = a a fund 1 16 1 2 = bit: 31 30 29 28 27 26 25 24 name: fundamental filter feedback coefficient byte 3 reset: 0x00 bit: 23 22 21 20 19 18 17 16 name: fundamental filter feedback coefficient byte 2 reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: fundamental filter feedback coefficient byte 1 reset: 0x03 bit: 7 6 5 4 3 2 1 0 name: fundamental filter feedback coefficient byte 0 reset: 0xb6 bit: 15 14 13 12 11 10 9 8 name: harmonic filter feed-forward coefficient high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: harmonic filter feed-forward coefficient low byte reset: 0x91 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 83 harmonic filter feedback coefficient (a1harm) (0x03c) this register specifies the a 1 (feedback) coefficient for the harmonic mode filter using the following formula: zero-cross lowpass filter (zc_lpf) (0x05a) this register specifies the lowpass filter applied for zero-cross detection. the msb of this register must be zero. a a harm 1 16 1 2 = bit: 31 30 29 28 27 26 25 24 name: harmonic filter feedback coefficient byte 3 reset: 0x00 bit: 23 22 21 20 19 18 17 16 name: harmonic filter feedback coefficient byte 2 reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: harmonic filter feedback coefficient byte 1 reset: 0x18 bit: 7 6 5 4 3 2 1 0 name: harmonic filter feedback coefficient byte 0 reset: 0x31 bit: 15 14 13 12 11 10 9 8 name: zero-cross lowpass filter high byte reset: 0x0b bit: 7 6 5 4 3 2 1 0 name: zero-cross lowpass filter low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 84 ______________________________________________________________________________________ hardware mirror registers adc configuration (r_acfg) (0x04c) this register is a mirror of a cpu register in the MAXQ3183. this register should not be modified by supervisorycode. adc conversion rate (r_adcrate) (0x04e) this register specifies the number of system clock cycles between consecutive adc conversions. it defaults to0x167 (359 decimal), which specifies 360 cpu clock cycles between conversions. this register is a mirror of a cpu register in the MAXQ3183. bit: 7 6 5 4 3 2 1 0 name: adcasd adcry adccd adcby adcie arbe adce reset: 0 0 0x0 0 1 1 1 bit name function 7 adcasd disable adc automatic shutdown. normally, the adc analog sectio n is powered off following a conversion to conserve power. if this bit is set, the adc leaves the ana log section powered on following a conversion. 6 adcry adc data ready. when a conversion is complete, this bit is set to in dicate that data is available. this bit generates an interrupt if adcie is set. 5:4 adccd adc clock divider. sets the division ratio between the cpu master and a dc clock. 00 = divide by 1 01 = divide by 2 10 = divide by 4 11 = reserved 3 adcby adc busy. when set, a single adc conversion cycle is in progress. t he bit is cleared on the conclusion of the conversion cycle. 2 adcie adc interrupt enable. if set, the adc interrupts the cp u at the completion of a conversion cycle. 1 arbe reference buffer enable. if set, the reference buffer is enabled to driv e the refo pin. 0 adce adc enable. if set, the adc hardware is activated. bit: 15 14 13 12 11 10 9 8 name: adc conversion rate high byte reset: 1 bit: 7 6 5 4 3 2 1 0 name: adc conversion rate low byte reset: 0x67 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 85 adc settling time (r_adcacq) (0x050) this register is a mirror of a cpu register in the MAXQ3183. this register should not be modified by supervisorycode. this register specifies the time, in cpu clocks, that the adc must wait after switching analog mux inputs before beginning its conversion. this register defaults to 0x2f (47 decimal), which specifies a 48 cpu clock-cycle delay from analog mux switching to the start of conversion. spi configuration (r_spicf) (0x052) this register is a mirror of a cpu register in the MAXQ3183. this register configures the spi port of the MAXQ3183. bit: 15 14 13 12 11 10 9 8 name: adc settling time high byte reset: bit: 7 6 5 4 3 2 1 0 name: adc settling time low byte reset: 0x2f bit: 7 6 5 4 3 2 1 0 name: espii sas chr ckpha ckpol reset: 1 0 0 0 0 0 0 0 bit name function 7 espii enable spi interrupt. if set, arrival of a chara cter on the spi bus causes a cpu interrupt. 6 sas spi slave select polarity. if clear, ssel is assumed to be active low; if set, ssel is assumed to be active high. 5:3 reserved. 2 chr spi character length. if clear, characters on the spi bus are assumed to be 8 bits; i f set, characters on the spi bus are assumed to be 16 bits. 1 ckpha spi clock phase. if clear, data is sampled on the leading edge of th e clock (low-to-high if the clock is active high, and high-to-low if the clock is active low). if set, data is sampled on the trailing edge of the clock (high-to-low if the clock is active high, and low-to-high if th e clock is active low). 0 ckpol spi clock polarity. if clear, the clock is assumed to be active high; if set, the clock is assumed to be active low. downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 86 ______________________________________________________________________________________ timeouts communications timeout (com_timo) (0x056) this register specifies the duration of spi timeout in adc frames (default 360s). energy accumulation timeout (acc_timo) (0x058) this register specifies the time in dsp cycles that the MAXQ3183 waits before accumulating energy. if this register isnonzero, it is decremented on each dsp cycle. if the result of the decrement is nonzero, the results of the dsp cycle are discarded and are not accumulated to the energy registers. this register is useful for delaying the initiation of energy accumulation on startup or after some hardware function has been modified. bit: 15 14 13 12 11 10 9 8 name: communications timeout high byte reset: 0x03 bit: 7 6 5 4 3 2 1 0 name: communications timeout low byte reset: 0xe8 bit: 15 14 13 12 11 10 9 8 name: energy accumulation timeout high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: energy accumulation timeout low byte reset: 0x05 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 87 phase-angle compensation phase offset current threshold 1 (i1thr) (0x05c) this register specifies the fraction of full-scale current that causes the MAXQ3183 to switch from pa0 to pa1 to pro-vide phase-angle compensation. for more information, see the pa0, pa1, and pa2 register descriptions. the full- scale current is represented by 0x10000. phase offset current threshold 2 (i2thr) (0x05e) this register specifies the fraction of full-scale current that causes the MAXQ3183 to switch from pa1 to pa2 to pro-vide phase-angle compensation. for more information, see the pa0, pa1, and pa2 register descriptions. the full- scale current is represented by 0x10000. miscellaneous gain neutral current gain (n.i_gain) (0x12e) this register contains gain compensation coefficient for the neutral current channel measurement. the raw valuesare taken from the selected measurement quantity and scaled by n.i_gain/2 14 . bit: 15 14 13 12 11 10 9 8 name: phase accumulator current threshold 1 high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: phase accumulator current threshold 1 low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: phase accumulator current threshold 2 high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: phase accumulator current threshold 2 low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: compensation coefficient high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: compensation coefficient low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 88 ______________________________________________________________________________________ gain, fundamental energy, phase x = a/b/c (x.ef_gain) (a: 0x136, b: 0x222, c: 0x30e) this register contains gain coefficient for phase x fundamental energy. the raw values are taken from the selectedmeasurement quantity and scaled by the following factor: linearity compensation linearity offset, high range, phase x = a/b/c (x.offs_hi) (a: 0x138, b: 0x224, c: 0x310) this signed register contains the linearity offset for phase x current channel when the programmable gain amplifieris set to unity gain (that is, the measured current is above the low current threshold). the signed value represented by this register is added to the current value according to following formula: x.irms + x.offs_hi x 2 4 linearity gain coefficient, low range, phase x = a/b/c (x.gain_lo) (a: 0x13a, b: 0x226, c: 0x312) this register contains the linearity coefficient for phase x current channel when the programmable gain amplifier isset to gain of 32 (that is, the measured current is below the low current threshold). the effective gain is given by the equation: xgain lo ._ 2 14 xef gain ._ 2 14 bit: 15 14 13 12 11 10 9 8 name: gain coefficient high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: gain coefficient low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: linearity offset high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: linearity offset low byte reset: 0x00 bit: 15 14 13 12 11 10 9 8 name: linearity coefficient high byte reset: 0x40 bit: 7 6 5 4 3 2 1 0 name: linearity coefficient low byte reset: 0x00 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 89 linearity offset, low range, phase x = a/b/c (x.offs_lo) (a: 0x13c, b: 0x228, c: 0x314) this signed register contains the linearity offset for phase x current channel when the programmable gain amplifieris set to gain of 32 (that is, the measured current is below the low current threshold). the signed value represented by this register is added to the current value. the total linearity compensation is applied as follows: x.gain_lo/2 14 x (x.irms + x.offs_lo) measurementsram registers on-demand rms result (n.irms) (0x11c) this register contains the result of the rms calculation on the aux channel. usually, this is the neutral current chan-nel, but can be defined to be the rms average of any harmonic of the quantities defined in the aux_mux field of the aux_cfg register. bit: 15 14 13 12 11 10 9 8 name: linearity offset high byte reset: 0x00 bit: 7 6 5 4 3 2 1 0 name: linearity offset low byte reset: 0x00 bit: 31 30 29 28 27 26 25 24 name: rms result, byte 3 reset: bit: 23 22 21 20 19 18 17 16 name: rms result, byte 2 reset: bit: 15 14 13 12 11 10 9 8 name: rms result, byte 1 reset: bit: 7 6 5 4 3 2 1 0 name: rms result, byte 0 reset: downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 90 ______________________________________________________________________________________ fundamental energy fundamental energy overflow flags, phase x = a/b/c (x.efover) (a: 0x147, b: 0x233, c: 0x31f) these bits indicate an overflow condition has occurred on a fundamental frequency energy accumulator. an over-flow condition is not an error condition. rather, it simply indicates that the value in the energy accumulator could be smaller than the previous reading due to the overflow in the counter. to obtain the actual energy usage since theprevious reading, 0x100000000 must be added to the difference. these bits, once set, can be cleared only by the host. energy, fundamental, real positive, phase x = a/b/c (x.eafpos) (a: 0x1fc, b: 0x2e8, c: 0x3d4) on every dsp cycle, the contents of the x.actf register are tested, and if positive, are added to this register. whenthis register overflows, the apfov bit in the x.efover register is set. bit name function 7:5 reserved. 4 sfov when set, indicates an overflow condition on the apparent fundamental -mode energy a ccumulator. 3 rnfov when set, indicates an overflow condition on the reactive negative fundamental-mod e energy accumulator. 2 rpfov when set, indicates an overflow condition on the reactive positive fundamental-mode ene rgy accumulator. 1 anfov when set, indicates an overflow condition on the real negativ e fundamental-mode energy accumulator. 0 apfov when set, indicates an overflow condition on the real positi ve fundamental-mode energy accumulator. bit: 7 6 5 4 3 2 1 0 name: sfov rnfov rpfov anfov apfov reset: 0 0 0 0 0 0 0 0 bit: 31 30 29 28 27 26 25 24 name: real energy byte 3 bit: 23 22 21 20 19 18 17 16 name: real energy byte 2 bit: 15 14 13 12 11 10 9 8 name: real energy byte 1 bit: 7 6 5 4 3 2 1 0 name: real energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 91 energy, fundamental, real negative, phase x = a/b/c (x.eafneg) (a: 0x200, b: 0x2ec, c: 0x3d8) on every dsp cycle, the contents of the x.actf register are tested, and, if negative, absolute values are added tothis register. when this register overflows, the anfov bit in the x.efover register is set. energy, fundamental, reactive positive, phase x = a/b/c (x.erfpos) (a: 0x204, b: 0x2f0, c: 0x3dc) on every dsp cycle, the contents of the x.reaf register are tested, and, if positive, are added to this register. whenthis register overflows, the rpfov bit in the x.efover register is set. bit: 31 30 29 28 27 26 25 24 name: real energy byte 3 bit: 23 22 21 20 19 18 17 16 name: real energy byte 2 bit: 15 14 13 12 11 10 9 8 name: real energy byte 1 bit: 7 6 5 4 3 2 1 0 name: real energy byte 0 bit: 31 30 29 28 27 26 25 24 name: reactive energy byte 3 bit: 23 22 21 20 19 18 17 16 name: reactive energy byte 2 bit: 15 14 13 12 11 10 9 8 name: reactive energy byte 1 bit: 7 6 5 4 3 2 1 0 name: reactive energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 92 ______________________________________________________________________________________ energy, fundamental, reactive negative, phase x = a/b/c (x.erfneg) (a: 0x208, b: 0x2f4, c: 0x3e0) on every dsp cycle, the contents of the x.reaf register are tested, and, if negative, absolute values are added tothis register. when this register overflows, the rnfov bit in the x.efover register is set. energy fundamental, apparent, phase x = a/b/c (x.esf) (a: 0x20c, b: 0x2f8, c: 0x3e4) on every dsp cycle, the contents of the x.esf register are added to this register. when this register overflows, thesfov bit in the x.efover register is set. when the MAXQ3183 is operating in low-power mode, energy is not accu- mulated. however, during low-power mode, current values are accumulated to this register, making this register accumulate ampere-hours. bit: 31 30 29 28 27 26 25 24 name: reactive energy byte 3 bit: 23 22 21 20 19 18 17 16 name: reactive energy byte 2 bit: 15 14 13 12 11 10 9 8 name: reactive energy byte 1 bit: 7 6 5 4 3 2 1 0 name: reactive energy byte 0 bit: 31 30 29 28 27 26 25 24 name: apparent energy byte 3 bit: 23 22 21 20 19 18 17 16 name: apparent energy byte 2 bit: 15 14 13 12 11 10 9 8 name: apparent energy byte 1 bit: 7 6 5 4 3 2 1 0 name: apparent energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 93 energy accumulated in the last dsp cycle real energy, phase x = a/b/c (x.act) (a: 0x1d0, b: 0x2bc, c: 0x3a8) this signed register provides the raw real energy accumulated over the most recent dsp cycle. for each adc sam-ple period, the real instantaneous power calculated from the instantaneous voltage and current is accumulated. at the end of each dsp cycle, the result of the accumulation over the dsp cycle is copied to this register and is accu- mulated in x.eapos or x.eaneg, depending on the sign of the accumulated energy. lsb of the energy registers is v fs x i fs x t fr /2 16 . reactive energy, phase x = a/b/c (x.rea) (a: 0x1d4, b: 0x2c0, c: 0x3ac) this signed register provides the raw reactive energy accumulated over the most recent dsp cycle. for each adcsample period, the reactive instantaneous power calculated from the instantaneous voltage and current is accumu- lated. at the end of each dsp cycle, the result of the accumulation over the dsp cycle is copied to this register and is accumulated in x.erpos or x.erneg, depending on the sign of the accumulated energy. bit: 31 30 29 28 27 26 25 24 name: real energy byte 3 bit: 23 22 21 20 19 18 17 16 name: real energy byte 2 bit: 15 14 13 12 11 10 9 8 name: real energy byte 1 bit: 7 6 5 4 3 2 1 0 name: real energy byte 0 bit: 31 30 29 28 27 26 25 24 name: reactive energy byte 3 bit: 23 22 21 20 19 18 17 16 name: reactive energy byte 2 bit: 15 14 13 12 11 10 9 8 name: reactive energy byte 1 bit: 7 6 5 4 3 2 1 0 name: reactive energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 94 ______________________________________________________________________________________ apparent energy, phase x = a/b/c (x.app) (a: 0x1d8, b: 0x2c4, c: 0x3b0) this signed register provides the raw apparent energy accumulated over the most recent dsp cycle. fundamental energy accumulated in the last dsp cycle fundamental real energy, phase x = a/b/c (x.actf) (a: 0x1dc, b: 0x2c8, c: 0x3b4) this signed register accumulates energy in the same fashion as the x.act register, but only at the fundamental linefrequency. bit: 31 30 29 28 27 26 25 24 name: apparent energy byte 3 bit: 23 22 21 20 19 18 17 16 name: apparent energy byte 2 bit: 15 14 13 12 11 10 9 8 name: apparent energy byte 1 bit: 7 6 5 4 3 2 1 0 name: apparent energy byte 0 bit: 31 30 29 28 27 26 25 24 name: real energy byte 3 bit: 23 22 21 20 19 18 17 16 name: real energy byte 2 bit: 15 14 13 12 11 10 9 8 name: real energy byte 1 bit: 7 6 5 4 3 2 1 0 name: real energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 95 fundamental reactive energy, phase x = a/b/c (x.reaf) (a: 0x1e0, b: 0x2cc, c: 0x3b8) this signed register accumulates energy in the same fashion as the x.rea register, but only at the fundamental linefrequency. fundamental apparent energy, phase x = a/b/c (x.appf) (a: 0x1e4, b: 0x2d0, c: 0x3bc) this register accumulates energy in the same fashion as the x.app register, but only at the fundamental line frequency. bit: 31 30 29 28 27 26 25 24 name: reactive energy byte 3 bit: 23 22 21 20 19 18 17 16 name: reactive energy byte 2 bit: 15 14 13 12 11 10 9 8 name: reactive energy byte 1 bit: 7 6 5 4 3 2 1 0 name: reactive energy byte 0 bit: 31 30 29 28 27 26 25 24 name: apparent energy byte 3 bit: 23 22 21 20 19 18 17 16 name: apparent energy byte 2 bit: 15 14 13 12 11 10 9 8 name: apparent energy byte 1 bit: 7 6 5 4 3 2 1 0 name: apparent energy byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 96 ______________________________________________________________________________________ checksum (chksum) (0x066) this register contains the calculated 16-bit arithmetic checksum over critical configuration and calibration registers.it is updated on every dsp cycle. in use, the administrative processor records the value in the chksum register and then checks it periodically to verify that no configuration or calibration registers have changed. the MAXQ3183 sets the chsch bit when this registers value changes. the registers included in the checksum calculation include the following: bit: 15 14 13 12 11 10 9 8 name: checksum high byte reset: bit: 7 6 5 4 3 2 1 0 name: checksum low byte reset: sys_khz thr2 r_adcrate a.i_gain b.i_gain c.i_gain volt_cc rej_ns r_adcacq a.v_gain b.v_gain c.v_gain amp_cc avg_ns r_spicf a.e_gain b.e_gain c.e_gain pwr_cc avg_c isumlvl a.ef_gain b.ef_gain c.ef_gain enr_cc hpf_c com_timo a.offs_hi b.offs_hi c.offs_hi cycnt b0fund acc_timo a.gain_lo b.gain_lo c.gain_lo plscfg1 oclvl i1thr a.offs_lo b.offs_lo c.offs_lo plscfg2 ovlvl i2thr a.pa0 b.pa0 c.pa0 pls1_wd uvlvl zc_lpf a.pa1 b.pa1 c.pa1 thr1 noload n.gain a.pa2 b.pa2 c.pa2 pls2_wd r_acfg temp_cc downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 97 measurementsvirtual registers fundamental real power, phase a/b/c/t (pwrpf.x) (a: 0x881, b: 0x882, c: 0x884, t: 0x887) this signed register contains the real instantaneous power delivered into phase a/b/c or total at the fundamental linefrequency only. power is calculated from the instantaneous energy measurement according to the following equation: fundamental reactive power, phase a/b/c/t (pwrqf.x) (a: 0x891, b: 0x892, c: 0x894, t: 0x897) this signed register contains the reactive instantaneous power delivered into phase a/b/c or total at the fundamentalline frequency only. power is calculated from the instantaneous energy measurement according to the following equation: pwrqf x xreaf pwr cc ns . ._ = 2 16 pwrpf x x actf pwr cc ns . ._ = 2 16 byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 98 ______________________________________________________________________________________ fundamental apparent power, phase a/b/c/t (pwrsf.x) (a: 0x8a1, b: 0x8a2, c: 0x8a4, t: 0x8a7) this register contains the instantaneous apparent power delivered into phase a/b/c or total at the fundamental linefrequency only. power is calculated from the instantaneous energy measurement according to the following equation: fundamental real energy, phase a/b/c/t (enrpf.x) (a: 0x8e1, b: 0x8e2, c: 0x8e4, t: 0x8e7) this signed register contains the real accumulated energy delivered into phase a/b/c or total. the register is calcu-lated according to the following formula: enrpf.x = enr_cc x (x.eafpos - x.eafneg) fundamental reactive energy, phase a/b/c/t (enrqf.x) (a: 0x8f1, b: 0x8f2, c: 0x8f4, t: 0x8f7) this signed register contains the reactive accumulated energy delivered into phase a/b/c or total. the register iscalculated according to the following formula: enrqf.x = enr_cc x (x.erfpos - x.erfneg) pwrsf x x appf pwr cc ns . ._ = 2 16 byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect ______________________________________________________________________________________ 99 fundamental apparent energy, phase a/b/c/t (enrsf.x) (a: 0x8b1, b: 0x8b2, c: 0x8b4, t: 0x8b7) this register contains the apparent accumulated energy delivered into phase a/b/c or total. the register is the prod-uct of the enr_cc and x.esf registers. current total harmonic distortion plus noise, phase a/b/c (thdn.x) (a: 0x859, b:0x85a, c: 0x85c) this signed register contains for a phase current the total harmonic distortion plus noise (power) ratio, computed asbelow, where x.irms fund is the fundamental current rms. note that the sign bit is at the most significant bit of byte 5. thdn x xirms xirms fund . . . = 2 2 1 byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 (lsbyte) byte 7 (msbyte unused) byte 6 (unused) byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect 100 _____________________________________________________________________________________ phasors phase b phasor (vbph: 0x852) this register reports phase angle of voltage phase bwith respect to voltage phase a. the value is expressed in units of 0.01 degree; thus, the nominal value is 12000 decimal (0x2ee0). this value is calculat- ed based on zero-crossing detection. it may exhibit noticable error in the presence of harmonics on voltage channels. this register is 2 bytes wide. phase c phasor (vcph: 0x854) this register reports phase angle of voltage phase cwith respect to voltage phase a. the value is expressed in units of 0.01 degree; thus, the nominal value is 24000 decimal (0x5dc0). this value is calcu- lated based on zero-crossing detection. it may exhibit noticable error in the presence of harmonics on voltage channels. this register is 2 bytes wide. harmonics rms voltage, harmonic (v.harm) (0x830) this register reports the rms voltage. the units aredefined by the volt_cc setting. use aux_cfg to configure the phase (a/b/c) and harmonic order desired. rms current, harmonic/neutral (i.n, i.harm) (0x840) this register reports the harmonic rms current ofselected phase (a/b/c) and harmonic order, harmonic, or the rms current of the neutral current channel. the units are defined by the amp_cc setting. use aux_cfg to configure the phase (a/b/c) and harmonicorder desired. ratio of harmonic/fundamental (harm_nf) (0x850) this register reports the ratio of the selected harmonicrms over the fundamental rms of the same signal (except in). the master must configure the aux_cfg register to enable the aux channel, enable harmonics, and select aux_mux before reading this register. this register is 4 bytes wide, lsb = 2 -16 . special commands table 7 shows the read-only virtual registers that acti-vate special commands when read by the master. some commands return dummy values. applications information grounds and bypassing careful pcb layout significantly minimizes noise on theanalog inputs, resulting in less noise on the digital i/o that could cause improper operation. the use of multi- layer boards is essential to allow the use of dedicated power planes. the area under any digital components should be a continuous ground plane if possible. keep any bypass capacitor leads short for best noise rejec- tion and place the capacitors as close to the leads of the devices as possible. the MAXQ3183 must have separate ground areas for the analog (agnd) and digital (dgnd) portions, con- nected together at a single point. name address description data length (bytes) upd_sfr 0x900 reading this register copies the mirror registers (r_adcf, r_adcr ate, r_adcacq, r_spicf) into hardware sfr registers. the read returns du mmy data. 1 upd_mir 0xa00 reading this register copies hardware sfr registers into mirr or registers (r_adcf, r_adcrate, r_adcacq, r_spicf). the read returns dummy data. 1 dspver 0xc00 reading this register returns the dsp firmwar e version number. 2 temp_c 0xc01 reading this register initiates the on-chip temperature sensor conversio n. upon completion, the temperature value is returned in degree celsius, with a resol ution of 1c. the temp_cc register must be configured before reading this register . 2 enter stop 0xc02 reading this register places the device into stop mode. 1 enter lowpm 0xc03 reading this register places the device into low pm mode. 1 exit lowpm 0xc04 reading this register exits lowpm mode. 1 table 7. virtual registers that activate special commands downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect _____________________________________________________________________________________ 101 package information for the latest package outline information and land patterns, go to www.maxim-ic.com/packages . note that a "+", "#", or "-" in the package code indicates rohs status only. package drawings may show a different suffix character, but the drawing pertains to the package regardless of rohs status. cmos design guidelines for any semiconductor requirethat no pin be taken above dvdd or below dgnd. violation of this guideline can result in a hard failure (damage to the silicon inside the device) or a soft fail- ure (unintentional modification of memory contents). voltage spikes above or below the devices absolute maximum ratings can potentially cause a devastating ic latchup. microcontrollers commonly experience negative volt- age spikes through either their power pins or general- purpose i/o pins. negative voltage spikes on power pins are especially problematic as they directly couple to the internal power buses. devices such as keypads can conduct electrostatic discharges directly into the microcontroller and seriously damage the device. system designers must protect components against these transients that can corrupt system memory. specific design considerations for MAXQ3183-based systems to reduce the possibility of coupling noise into themicrocontroller, the system should be designed with a crystal or oscillator in a metal case that is grounded to the digital plane. doing so reduces the susceptibility of the design to fast transient noise. because the MAXQ3183 is designed for use in systems where high voltages are present, care must be taken to route all signal paths, both analog and digital, as far away as possible from the high-voltage components. it is possible to construct more elaborate metering designs using multiple MAXQ3183 devices. this can be accomplished by using a single spi bus to connect all the MAXQ3183 devices together but using separate slave select lines to individually select each MAXQ3183. additional documentation designers must ensure they have the latest MAXQ3183errata documents. errata sheets contain deviations from published specifications. a MAXQ3183 errata sheet for any specific device revision is available at www.maxim-ic.com/errata . technical support for technical support, go to https://support.maxim- ic.com/micro . package type package code document no. 28 tssop u28+3 21-0066 top view MAXQ3183 tssop 25 4 avdd i0n 26 3 v0p i0p 27 2 v1p inp 28 1 v2p vn 22 7 dvdd i2p 23 6 vcomm i1n 21 8 reset i2n 20 9 cfq agnd 19 10 cfp xtal2 18 11 dgnd xtal1 17 12 dvdd irq 16 13 miso ssel 24 5 vref i1p 15 14 mosi sclk pin configuration downloaded from: http:///
MAXQ3183 low-power, multifunction, polyphase afe with harmonics and tamper detect maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim product. no circuit patent licenses are implied. maxim reserves the right to change the circuitry and specifications without notice at any time. 102 ___________________maxim integrated products, 120 san gabriel drive, sunnyvale, ca 94086 408-737-7600 ? 2009 maxim integrated products maxim is a registered trademark of maxim integrated products, inc. MAXQ3183 v0p ssel sclk mosi miso r1 r2 v1p r1 r2 v2p vn vcomm r1 r2 i0pi0n r3r3 i1pi1n i2pi2n voltage sense v a v b v c n current transformer l c l b l a r3r3 r3r3 master typical application circuit downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of MAXQ3183

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X